# Why do Pareto/NBD models require custom likelihood functions in PyMC3 and Stan?

I'm interested in Bayesian modeling of customer lifetime value (CLV), preferably via PyMC3. I've found that research in this area started mid-to-late 1900's and has remained active since. It would seem that some combination of Exponential, poisson, Negative Binomial, Gamma, and Pareto distributions are frequently used. However, the likelihood function is not a "stock" distribution built into popular probabilistic programming tools (such as PyMC3 and Stan.) In consequence, various authors have derived custom likelihood functions to ensure successful posterior sampling.

Here are two such implementations:

And this paper by Fader/Hardie seems to contribute some ideas central to the first link and at the very least, inspirational to the second.

Here is my current understanding of the Bayesian CLV design:

1. The number of purchases made by any given customer (irregardless of dollar) are Poisson distributed when (and only when) in an active state; so far, this reminds me of zero-inflated Poisson regression. Customers vary, but pooling share information between customers and the Gamma distribution is used to accomplish this effect in some way.

2. Each customer has a fixed but latent lifetime. The exponential distribution is used to model time until the next period of activity. I'm not positive on the link between these ideas; perhaps an extremely long period of inactivity, associated with a very small likelihood of the exponential PDF mitigates future events described by the Poisson distribution in some way.

3. The PyMC3 implementation models the per customer average purchase value, which seems to be an integral part of the model in virtually any situation, unless a given business sells only one product at a fixed price or variations in price are negligible.

My biggest point of confusions are (A) the link between inactivity and a customer never returning, (B) How parameters are pooled such that customers receive their own "parameters" but inter-parameter communication exists, (C) How a given dollar value, the customer's CLV, can be inferred by combining these elements, and (D) How/Why a customer likelihood function is necessary to achieve this effect.

In this question, I'm soliciting answers that clarify any/all of the above.

I'd recommend you to check first whether the model assumptions are valid in the context of your data. Mainly, I'd check whether the inter-transaction times $$\{\Delta T_n\}_{n\geq 1}$$ are indeed exponentially distributed, or at least equally distributed... (Here $$\Delta T_n$$ denotes time in-between the $$n$$-th transaction and the previous one.) Notice that if doesn't happen then you'll have evidence to discard an underlying Poisson process for occurrence of the purchases -see also Section 2.2 here.