MMMPlotSuite.posterior_predictive#
- MMMPlotSuite.posterior_predictive(var=None, idata=None, hdi_prob=0.85)[source]#
Plot time series from the posterior predictive distribution.
By default, if both
varandidataare not provided, usesself.idata.posterior_predictiveand defaults the variable to["y"].- Parameters:
- var
listofstr, optional A list of variable names to plot. Default is [“y”] if not provided.
- idata
xarray.Dataset, optional The posterior predictive dataset to plot. If not provided, tries to use
self.idata.posterior_predictive.- hdi_prob: float, optional
The probability mass of the highest density interval to be displayed. Default is 0.85.
- var
- Returns:
- fig
matplotlib.figure.Figure The Figure object containing the subplots.
- axes
np.ndarrayofmatplotlib.axes.Axes Array of Axes objects corresponding to each subplot row.
- fig
- Raises:
ValueErrorIf no
idatais provided andself.idata.posterior_predictivedoes not exist, instructing the user to runMMM.sample_posterior_predictive(). Ifhdi_probis not between 0 and 1, instructing the user to provide a valid value.