Gamma-Gamma Model of Monetary Value
Summary
The gamma-gamma (GG) model is the spend sub-model that turns a transaction forecast into a value forecast. Each transaction amount is gamma distributed around a customer-specific mean; the gamma’s rate parameter varies across customers as another gamma; and the whole spend process is assumed independent of the transaction process. Conjugacy yields a closed-form marginal for a customer’s observed average spend (a beta distribution of the second kind) and a conditional expectation that is a precision-weighted average of the population mean and the customer’s own average — a textbook shrinkage estimator. Fader & Hardie’s 2013 note gives the full derivation of the model first used in Fader, Hardie & Lee (2005), which adapted Colombo & Jiang (1999).
Overview
Why model spend at all, when the customer’s average is observed? Because is computed from very few transactions. Fader, Hardie & Lee’s example: the mean spend across all customers is $35, but customer A has made one repeat purchase of $100. “Should we assume that E(M) = m_1 = \100x\to\infty$, “but this could be a slow process.”
Schmittlein & Peterson (1994) used a normal-normal model. The note lists two problems: the normal “is not bounded from below by 0” and “results in a symmetric spend distribution”, while real spend data are right-skewed (CDNOW: mean $35, median $27, mode $15, skewness 4, kurtosis 17). A lognormal would fit but “there is no closed-form expression for the convolution of lognormals”, so the distribution of is intractable. The gamma has “similar properties to those of the lognormal (albeit with a slightly thinner tail)” and is closed under convolution and scaling.
Main Content
Gamma-gamma assumptions ^def-gg-assumptions
General assumptions (Fader & Hardie 2013, Sec. 1):
- The monetary value of a customer’s given transaction varies randomly around their average transaction value.
- Average transaction values vary across customers but do not vary over time for any given individual.
- The distribution of average transaction values across customers is independent of the transaction process.
Distributional form (Sec. 2): with shape and rate , so ; and across customers. The shape is common to all customers, which “is equivalent to assuming that the individual-level coefficient of variation is the same for all customers ()” (2005, Sec. 2.1).
By the convolution property total spend over transactions is , and by the scaling property .
Marginal distribution of average spend ^thm-gg-marginal
Integrating out (Eqs. 1a–1b):
This is a beta distribution of the second kind (B2). The second form is numerically safer for large and because both bases are below one (note 025, fn. 1). The sample log-likelihood is over customers with (Eq. 6).
Distribution of the latent mean spend ^thm-gg-latent-mean
Since with , a change of variables gives an inverse-gamma with shape and scale (Eqs. 2–4):
Conditional expectation of mean spend (shrinkage form) ^thm-gg-conditional-expectation
The posterior of given is , hence (Eq. 5)
“This is the weighted average of the population mean, , and the observed average transaction value, . As the number of observations () used to compute increases, less weight is placed on the population mean.”
This is the same algebra as the normal-normal posterior mean in Hierarchical Models and the linear shrinkage rule in Empirical Bayes Interpretation of Shrinkage, with playing the role of the data’s precision and the prior’s. For a customer with no repeat transactions (), and the forecast is the population mean.
The independence assumption
Assumption 3 is what lets CLV factor into transactions × spend (CLV decomposition). Fader, Hardie & Lee (2005, Sec. 2.2) check it on the 946 CDNOW customers with at least one repeat purchase: the correlation between average transaction value and number of transactions is 0.11, “largely driven by one outlier” (21 transactions averaging $300); removing it gives 0.06 (). Box plots by frequency show “the variation within each number-of-transactions group dominates the between-group variation.” They caution that “any researcher applying our model to a new dataset must test the validity of the assumption”, and sketch two relaxations: a bivariate Sarmanov distribution with gamma marginals linking and , or “a hierarchical Bayesian formulation of the basic model” (Sec. 5). Wang, Liu & Miao (2019) call the independence assumption “shaky” — “frequent purchasers may spend less on each purchase” — as motivation for direct regression (Bayesian and Hierarchical Extensions of CLV Models).
A subtle consequence (2005, Sec. 5): even with true independence, regression to the mean is stronger for low-frequency customers than high-frequency ones, which “creates the illusion” that monetary value and frequency are more tightly connected than they are.
Empirical results (CDNOW)
- MLEs: , , (constraints: all ; Excel Solver).
- Implied population mean p\gamma/(q-1)=\35.2; the paper reports the theoretical mean differs from the observed mean of customer averages (\35.08) “by a mere nine cents”.
- Model fit is judged by mixing over the empirical distribution of and comparing with a kernel density of observed . “The fit is reasonable. However, the theoretical mode of $19 is greater than the observed mode of $15, which corresponds to the typical price of a CD” — the model knows nothing about price points.
- Stability: parameters estimated on all 78 weeks give a 39-week log-likelihood of versus the 39-week optimum of , “strong support for our assumption that the sub-model governing monetary value is stable over time” (2005, Sec. 4).
- Do not compare the inverse-gamma with the histogram of : the former is “effectively the distribution where the means have been computed across transactions” (note 025, Sec. 3).
Examples
How fast does shrinkage fade? With CDNOW parameters the prior weight is .
| E(Z\mid\bar z=\100)$ | E(Z\mid\bar z=\20)$ | ||
|---|---|---|---|
| 0 | 1.000 | 35.22 | 35.22 |
| 1 | 0.305 | 80.26 | 24.64 |
| 2 | 0.180 | 88.35 | 22.74 |
| 7 | 0.059 | 96.18 | 20.90 |
| 10 | 0.042 | 97.28 | 20.64 |
(Own calculation from Eq. 5.) After a single $100 purchase the model already moves about 70% of the way from $35 to $100, because implies a fairly tight individual-level coefficient of variation (). The paper’s reading of its Figure 12: “Not until the customer has made 7–8 transactions can we trust the observed value of .”
import numpy as np
from scipy.special import gammaln
from scipy.optimize import minimize
def gg_negloglik(theta, x, zbar): # Eq. 1a, customers with x >= 1
p, q, g = np.exp(theta)
ll = (gammaln(p*x+q) - gammaln(p*x) - gammaln(q) + q*np.log(g)
+ (p*x-1)*np.log(zbar) + p*x*np.log(x) - (p*x+q)*np.log(g + x*zbar))
return -ll.sum()
def gg_expected_spend(p, q, g, x, zbar): # Eq. 5
return p*(g + x*zbar) / (p*x + q - 1)Connections
- Customer Lifetime Value - Overview — spend is one of the three factors in CLV = margin × spend × DET.
- RFM Sufficient Statistics and Iso-Value Curves — uses as the “DET multiplier”; are the M and F of RFM.
- Pareto-NBD Model and BG-NBD Model — the transaction models it is paired with under independence.
- Single-Parameter Models — gamma likelihood with gamma prior on the rate is a standard conjugate pair.
- Empirical Bayes Interpretation of Shrinkage and James-Stein Estimator — same weighted-average structure; here weights come from a fitted gamma prior rather than a normal one.
- Hierarchical Models — partial pooling of customer means toward the population mean.
See Also
- Bayesian and Hierarchical Extensions of CLV Models — PyMC-Marketing’s
GammaGammaModeland relaxing independence. - Monsters and Mixtures — continuous mixture models for over-dispersed data.
- Generalized Linear Models — gamma regression as the covariate-driven alternative for skewed positive outcomes.