Skip to content

Commit

Permalink
Add danger warning about buggy behavior of Deterministics in `sample_…
Browse files Browse the repository at this point in the history
…posterior_predictive`
  • Loading branch information
ricardoV94 committed Mar 1, 2024
1 parent a1454ab commit 08fca4e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pymc/sampling/forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -666,9 +666,8 @@ def sample_posterior_predictive(
# Sampling: [x, y, z, obs]
Note that "sampling" a :func:`~pymc.Deterministic` does not force random variables
that depend on this quantity to be sampled too. In the following example ``z`` will not
be resampled even though it depends on ``det_xy``:
.. 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:
.. code :: python
Expand All @@ -683,7 +682,7 @@ def sample_posterior_predictive(
idata = pm.sample(tune=10, draws=10, chains=2, **kwargs)
pm.sample_posterior_predictive(idata, var_names=["det_xy", "det_z"], **kwargs)
# Sampling: []
# Sampling: [z]
Controlling the number of samples
Expand Down

0 comments on commit 08fca4e

Please sign in to comment.