Skip to content

Commit 46f1675

Browse files
ricardoV94AlexAndorra
authored andcommitted
Add danger warning about buggy behavior of Deterministics in sample_posterior_predictive
1 parent 547e2e0 commit 46f1675

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

pymc/sampling/forward.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -666,9 +666,8 @@ def sample_posterior_predictive(
666666
# Sampling: [x, y, z, obs]
667667
668668
669-
Note that "sampling" a :func:`~pymc.Deterministic` does not force random variables
670-
that depend on this quantity to be sampled too. In the following example ``z`` will not
671-
be resampled even though it depends on ``det_xy``:
669+
.. danger:: Including a :func:`~pymc.Deterministic` in `var_names` may incorrectly force a random variable to be resampled, as happens with ``z`` in the following example:
670+
672671
673672
.. code :: python
674673
@@ -683,7 +682,7 @@ def sample_posterior_predictive(
683682
idata = pm.sample(tune=10, draws=10, chains=2, **kwargs)
684683
685684
pm.sample_posterior_predictive(idata, var_names=["det_xy", "det_z"], **kwargs)
686-
# Sampling: []
685+
# Sampling: [z]
687686
688687
689688
Controlling the number of samples

0 commit comments

Comments
 (0)