Skip to content

Commit

Permalink
fix dtype issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ahartikainen committed Jan 13, 2019
1 parent 1fdb4d6 commit 3711d6f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions arviz/plots/ppcplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ def plot_ppc(
else:
alpha = 0.2

assert jitter >= 0
if jitter is None:
jitter = 0.0
assert jitter >= 0.0

observed = data.observed_data
posterior_predictive = data.posterior_predictive
Expand Down Expand Up @@ -387,7 +389,7 @@ def plot_ppc(
scale_low = 0
scale_high = jitter_scale * jitter

obs_yvals = np.zeros_like(obs_vals)
obs_yvals = np.zeros_like(obs_vals, dtype=np.float64)
if jitter:
obs_yvals += np.random.uniform(low=scale_low, high=scale_high, size=len(obs_vals))
ax.plot(
Expand All @@ -403,7 +405,7 @@ def plot_ppc(

for vals, y in zip(pp_sampled_vals, y_rows[1:]):
vals = np.array([vals]).flatten()
yvals = np.full(len(vals), y)
yvals = np.full_like(vals, y, dtype=np.float64)
if jitter:
yvals += np.random.uniform(low=scale_low, high=scale_high, size=len(vals))
ax.plot(vals, yvals, "o", zorder=1, color="C5", markersize=markersize, alpha=alpha)
Expand Down

0 comments on commit 3711d6f

Please sign in to comment.