BetaGeoNBD#

class pymc_marketing.clv.distributions.BetaGeoNBD(name: str, *args, rng=None, dims: str | Sequence[str | None] | None = None, initval=None, observed=None, total_size=None, transform=UNSET, default_transform=UNSET, **kwargs)[source]#

Population-level distribution class for a discrete, non-contractual, Beta-Geometric/Negative-Binomial process.

Based on Fader, et al. in [1], [2] and enhancements for numerical stability in [3].

\[\begin{split}\mathbb{LL}(r, \alpha, a, b | x, t_x, T) = D_1 + D_2 + \ln(C_3 + \delta_{x>0} C_4) \text{, where:} \\ \begin{align} D_1 &= \ln \left[ \Gamma(r+x) \right] - \ln \left[ \Gamma(r) \right] + \ln \left[ \Gamma(a+b) \right] + \ln \left[ \Gamma(b+x) \right] \\ D_2 &= r \ln(\alpha) - (r+x) \ln(\alpha + t_x) \\ C_3 &= \left(\frac{\alpha + t_x}{\alpha + T} \right)^{r+x} \\ C_4 &= \left(\frac{a}{b+x-1} \right) \\ \end{align}\end{split}\]

Support

\(t_j >= 0\) for \(j = 1, \dots,x\)

Mean

\(\mathbb{E}[X(n) | r, \alpha, a, b] = \frac{a+b-1}{a-1} \left[ 1 - \left(\frac{\alpha}{\alpha + T}\right)^r {_2}{F}{_1}(r,b;a+b-1;\frac{t}{\alpha + t}) \right]\)

References

[1]

Fader, Peter S., Bruce G.S. Hardie, and Jen Shang (2010), “Counting Your Customers” the Easy Way: An Alternative to the Pareto/NBD Model Marketing Science, 24 (Spring), 275-284

[2]

Implementing the BG/NBD Model for Customer Base Analysis in Excel http://brucehardie.com/notes/004/bgnbd_spreadsheet_note.pdf

[3]

Overcoming the BG/NBD Model’s #NUM! Error Problem https://brucehardie.com/notes/027/bgnbd_num_error.pdf

Methods

BetaGeoNBD.__init__(*args, **kwargs)

BetaGeoNBD.dist(a, b, r, alpha, T, **kwargs)

Get the distribution from the parameters.

BetaGeoNBD.logp(a, b, r, alpha, T)

Log-likelihood of the distribution.

Attributes

rv_op