Skip to content

Commit 8e34b01

Browse files
AustinRochfordtwiecki
authored andcommitted
ENH Add random_seed keyword argument to sample_ppc (#1389)
1 parent 36c478f commit 8e34b01

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pymc3/sampling.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ def _soft_update(a, b):
314314
a.update({k: v for k, v in b.items() if k not in a})
315315

316316

317-
def sample_ppc(trace, samples=None, model=None, vars=None, size=None):
317+
def sample_ppc(trace, samples=None, model=None, vars=None, size=None, random_seed=None):
318318
"""Generate posterior predictive samples from a model given a trace.
319319
320320
Parameters
@@ -347,6 +347,8 @@ def sample_ppc(trace, samples=None, model=None, vars=None, size=None):
347347
if vars is None:
348348
vars = model.observed_RVs
349349

350+
seed(random_seed)
351+
350352
ppc = defaultdict(list)
351353
for idx in randint(0, len(trace), samples):
352354
param = trace[idx]

0 commit comments

Comments
 (0)