aimz.ImpactModel.sample_posterior_predictive_on_batch#
- ImpactModel.sample_posterior_predictive_on_batch(X, *, intervention=None, rng_key=None, return_sites=None, return_datatree=True, **kwargs)[source]#
Draw samples from the posterior predictive distribution.
This method is a convenience alias for
predict_on_batch(), within_sampleautomatically set toTrue.- Parameters:
X (ArrayLike) – Input data. The leading axis is the sample axis.
intervention (dict | None) – A dictionary mapping sample sites to their corresponding intervention values. Interventions enable counterfactual analysis by modifying the specified sample sites during prediction (posterior predictive sampling).
rng_key (Array | None) – A pseudo-random number generator key. By default, an internal key is used and split as needed.
return_sites (str | Iterable[str] | None) – Names of variables (sites) to return. If
None, samplesparam_outputand deterministic sites.return_datatree (bool) – If
True, return aDataTree; otherwise return adict.**kwargs (object) – Additional arguments passed to the model.
- Returns:
Posterior predictive samples. Posterior samples are included if available.
- Raises:
TypeError – If
param_outputis passed as an argument.- Return type:
See also