Skip to content

Commit

Permalink
fix not using all samples (#4212)
Browse files Browse the repository at this point in the history
  • Loading branch information
aloctavodia authored Nov 9, 2020
1 parent aa7d466 commit 3f14968
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pymc3/sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -1721,7 +1721,7 @@ def sample_posterior_predictive(
param = cast(MultiTrace, _trace)._straces[chain_idx % nchain].point(point_idx)
# ... or a PointList
else:
param = cast(PointList, _trace)[idx % len_trace]
param = cast(PointList, _trace)[idx % (len_trace * nchain)]
# there's only a single chain, but the index might hit it multiple times if
# the number of indices is greater than the length of the trace.
else:
Expand All @@ -1730,7 +1730,6 @@ def sample_posterior_predictive(
values = draw_values(vars, point=param, size=size)
for k, v in zip(vars, values):
ppc_trace_t.insert(k.name, v, idx)

except KeyboardInterrupt:
pass

Expand Down

0 comments on commit 3f14968

Please sign in to comment.