Deterministic posterior predictive?

We considered that behavior useless, it would just be copying a value from the posterior to the posterior_predictive group. You can do that directly with the inference data

idata.posterior_predictive["a"] = idata.posterior["a"]

You can still compute deterministics just fine, pass them to var_names (but not the RVs on which they depend).

import pymc as pm
import numpy as np

with pm.Model() as m:
  x = pm.Normal("x")
  det = pm.Deterministic("det", x + 1)
  idata = pm.sample()
  pp = pm.sample_posterior_predictive(idata, var_names=["det"])

np.testing.assert_allclose(idata.posterior["x"] + 1, pp.posterior_predictive["det"])
1 Like