MMM.sample_posterior_predictive#

MMM.sample_posterior_predictive(X=None, extend_idata=True, combined=True, include_last_observations=False, clone_model=True, **sample_posterior_predictive_kwargs)[source]#

Sample from the model’s posterior predictive distribution.

Parameters:
Xpd.DataFrame

Input data for prediction, with the same structure as the training data.

ypd.Series, optional

Optional target data for validation or alignment. Default is None.

extend_idatabool, optional

Whether to add predictions to the inference data object. Defaults to True.

combinedbool, optional

Combine chain and draw dimensions into a single sample dimension. Defaults to True.

include_last_observationsbool, optional

Whether to include the last observations of the training data for continuity (useful for adstock transformations). Defaults to False.

clone_modelbool, optional

Whether to clone the model. Defaults to True.

**sample_posterior_predictive_kwargs

Additional arguments for pm.sample_posterior_predictive.

Returns:
xr.DataArray

Posterior predictive samples.