MMMPlotSuite.residuals_over_time#
- MMMPlotSuite.residuals_over_time(hdi_prob=None)[source]#
Plot residuals over time by taking the difference between true values and predicted.
Computes residuals = true values - predicted using target data from constant_data and predictions from posterior_predictive. Works with any model dimensionality.
- Parameters:
- 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
y_original_scaleis not in posterior_predictive, instructing the user that this plot requires the original scale predictions. Iftarget_datais not in constant_data. If any HDI probability is not between 0 and 1.
Examples
Plot residuals over time with default 94% HDI:
mmm.plot.residuals_over_time()
Plot residuals with multiple HDI bands:
mmm.plot.residuals_over_time(hdi_prob=[0.94, 0.50])