Skip to content

Commit 3f14968

Browse files
authored
fix not using all samples (#4212)
1 parent aa7d466 commit 3f14968

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pymc3/sampling.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1721,7 +1721,7 @@ def sample_posterior_predictive(
17211721
param = cast(MultiTrace, _trace)._straces[chain_idx % nchain].point(point_idx)
17221722
# ... or a PointList
17231723
else:
1724-
param = cast(PointList, _trace)[idx % len_trace]
1724+
param = cast(PointList, _trace)[idx % (len_trace * nchain)]
17251725
# there's only a single chain, but the index might hit it multiple times if
17261726
# the number of indices is greater than the length of the trace.
17271727
else:
@@ -1730,7 +1730,6 @@ def sample_posterior_predictive(
17301730
values = draw_values(vars, point=param, size=size)
17311731
for k, v in zip(vars, values):
17321732
ppc_trace_t.insert(k.name, v, idx)
1733-
17341733
except KeyboardInterrupt:
17351734
pass
17361735

0 commit comments

Comments
 (0)