Skip to content

Commit 5dfd082

Browse files
author
Junpeng Lao
authored
Merge pull request #2864 from junpenglao/fast_kde_fix
Small fix for fast_kde
2 parents a3af00d + 55729cf commit 5dfd082

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pymc3/plots/kdeplot.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ def fast_kde(x, bw=4.5):
7777

7878
dx = (xmax - xmin) / (nx - 1)
7979
std_x = entropy((x - xmin) / dx) * bw
80+
if ~np.isfinite(std_x):
81+
std_x = 0.
8082
grid, _ = np.histogram(x, bins=nx)
8183

8284
scotts_factor = n ** (-0.2)

0 commit comments

Comments
 (0)