aimz.ImpactModel.sample#
- ImpactModel.sample(*, num_samples=1000, rng_key=None, return_sites=None, return_datatree=True, **kwargs)[source]#
Draw posterior samples from a fitted model.
- Parameters:
num_samples (int) – The number of posterior samples to draw.
rng_key (Array | None) – A pseudo-random number generator key. By default, an internal key is used and split as needed. Ignored if the inference method is MCMC, where the
post_warmup_stateproperty will be used to continue sampling.return_sites (str | Iterable[str] | None) – Names of variables (sites) to return. If
None, samples all latent sites. Ignored if the inference method is MCMC.return_datatree (bool) – If
True, return aDataTree; otherwise return adict.**kwargs (object) – Additional arguments passed to the model. Only relevant when the inference method is MCMC.
- Returns:
Posterior samples.
- Raises:
TypeError – If
param_outputis not passed as an argument when the inference method is MCMC.- Return type: