plot_decomposition#

pymc_marketing.bass.plotting.plot_decomposition(model, product=None, n_samples=10, hdi_probs=None, random_seed=None, subplot_kwargs=None, axes=None)[source]#

Plot the adoption decomposition into innovators and imitators.

Innovators and imitators (new adopters per period) are drawn on the left y-axis. Cumulative adoption and the observed cumulative counts are drawn on a twin right y-axis, since they are on a much larger scale and would otherwise dwarf the per-period curves.

Parameters:
modelBassModel

A fitted Bass model.

productstr, optional

Plot a single product of a multi-product model. Default plots one subplot per product.

n_samplesint, optional

Number of posterior sample curves to draw. Default is 10.

hdi_probsfloat or list of float, optional

HDI probabilities. Defaults to the ArviZ default (0.94).

random_seednp.random.Generator, optional

Random number generator for sample selection.

subplot_kwargsdict, optional

Additional kwargs for the subplot creation, e.g. figsize.

axesndarray of Axes, optional

Existing axes to plot on.

Returns:
tuple[Figure, ndarray of Axes]

Figure and the primary (left) axes. The twin (right) axes are accessible through fig.axes.