MMMPlotSuite.contributions_over_time#
- MMMPlotSuite.contributions_over_time(var, hdi_prob=0.85, dims=None)[source]#
Plot the time-series contributions for each variable in
var
.showing the median and the credible interval (default 85%). Creates one subplot per combination of non-(chain/draw/date) dimensions and places all variables on the same subplot.
- Parameters:
- var
list
ofstr
A list of variable names to plot from the posterior.
- hdi_prob: float, optional
The probability mass of the highest density interval to be displayed. Default is 0.85.
- dims
dict
[str
,str
|int
|list
], optional Dimension filters to apply. Example: {“country”: [“US”, “UK”], “user_type”: “new”}. If provided, only the selected slice(s) will be plotted.
- var
- Returns:
- fig
matplotlib.figure.Figure
The Figure object containing the subplots.
- axes
np.ndarray
ofmatplotlib.axes.Axes
Array of Axes objects corresponding to each subplot row.
- fig
- Raises:
ValueError
If
hdi_prob
is not between 0 and 1, instructing the user to provide a valid value.