create_bass_model#

pymc_marketing.bass.model.create_bass_model(t, observed, priors, coords)[source]#

Define a Bass diffusion model for product adoption forecasting.

This function creates a Bayesian Bass diffusion model using PyMC to forecast product adoption over time. The Bass model captures both innovation (external influence like advertising) and imitation (internal influence like word-of-mouth) effects in the adoption process.

The model includes the following components:

  • Market potential ‘m’: Total number of eventual adopters

  • Innovation coefficient ‘p’: Measures external influence

  • Imitation coefficient ‘q’: Measures internal influence

  • Adopters over time: Number of new adopters at each time point

  • Innovators: Adopters influenced by external factors

  • Imitators: Adopters influenced by previous adopters

  • Peak adoption time: When adoption rate reaches maximum

Parameters:
tpt.TensorLike

Time points for which the adoption is modeled.

observedpt.TensorLike | None

Observed adoption data at each time point. If None, only prior predictive sampling is possible.

priorsdict[str, Prior | Censored | VariableFactory]

Dictionary containing priors for: - ‘m’: Market potential prior - ‘p’: Innovation coefficient prior - ‘q’: Imitation coefficient prior - ‘likelihood’: Observation likelihood model

coordsdict[str, Any]

Coordinate values for dimensions in the model, including ‘date’ for the time dimension and any other dimensions included in the prior specifications.

Returns:
Model

A PyMC model object for the Bass diffusion model, containing the variables m, p, q, adopters, innovators, imitators, peak, and the likelihood y.

Notes

The returned model can be used for prior predictive checks, posterior sampling, and posterior predictive checks to forecast product adoption.

The model implements the following mathematical relationships:

\[\begin{split}\text{adopters}(t) &= m \cdot f(p, q, t) \\ \text{innovators}(t) &= m \cdot p \cdot (1 - F(p, q, t)) \\ \text{imitators}(t) &= m \cdot q \cdot F(p, q, t) \cdot (1 - F(p, q, t)) \\ \text{peak} &= \frac{\ln(q) - \ln(p)}{p + q}\end{split}\]