MMM.sample_posterior_predictive#
- MMM.sample_posterior_predictive(X=None, extend_idata=True, combined=True, include_last_observations=False, original_scale=True, **sample_posterior_predictive_kwargs)[source]#
Sample from the model’s posterior predictive distribution.
- Parameters:
- X
array
,shape
(n_pred
,n_features
) The input data used for prediction.
- extend_idatabool, optional
Boolean determining whether the predictions should be added to inference data object. Defaults to True.
- combined: bool, optional
Combine chain and draw dims into sample. Won’t work if a dim named sample already exists. Defaults to True.
- include_last_observations: bool, optional
Boolean determining whether to include the last observations of the training data in order to carry over costs with the adstock transformation. Assumes that X are the next predictions following the training data.Defaults to False.
- original_scale: bool, optional
Boolean determining whether to return the predictions in the original scale of the target variable. Defaults to True.
- **sample_posterior_predictive_kwargs
Additional arguments to pass to pymc.sample_posterior_predictive
- X
- Returns:
- posterior_predictive_samples
DataArray
,shape
(n_pred
,samples
) Posterior predictive samples for each input X
- posterior_predictive_samples