Customer Lifetime Value (BG/NBD and Gamma-Gamma)
Predict what each customer will be worth. From the dates and amounts of past orders, the BG/NBD model estimates how often customers buy and how likely they are to still be active, the Gamma-Gamma model estimates how much they spend, and together they give a discounted lifetime value per customer.
Updated · By Bibin XavierData 3775 × 4
| Customer_IDtext · 520 levels | Order_Datetext · 711 levels | Amountnumeric | Channeltext · 3 levels |
|---|---|---|---|
| C0109 | 2023-01-02 | 46.6 | App |
| C0461 | 2023-01-02 | 135.38 | App |
| C0512 | 2023-01-02 | 101.19 | App |
| C0461 | 2023-01-03 | 67.9 | App |
| C0511 | 2023-01-06 | 65.28 | Web |
| C0109 | 2023-01-07 | 59.7 | App |
| C0195 | 2023-01-07 | 73.29 | App |
| C0457 | 2023-01-07 | 19.37 | App |
Variables and options
Results
3775 rows · example dataBG/NBD purchase model
| Parameter | Estimate | SE | Meaning |
|---|---|---|---|
| r | 1.3130 | 0.1061 | Shape of the purchase-rate distribution |
| α | 6.2381 | 0.6247 | Scale (in weeks); mean purchase rate of active customers = r/α = 0.2105 per week |
| a | 0.6953 | 0.1254 | Dropout distribution (Beta) shape a |
| b | 3.5514 | 0.9142 | Dropout distribution shape b; mean chance of becoming inactive after a purchase = a/(a+b) = 16.4% |
Note. Maximum likelihood (Fader, Hardie and Lee, 2005), log-likelihood = -1503.40. Frequency = repeat purchase days, recency and age (T) in weeks, observation period ending 2024-12-31.
Gamma-Gamma spend model
| Parameter | Estimate | SE |
|---|---|---|
| p | 5.4711 | 1.2525 |
| q | 6.6837 | 0.6993 |
| γ | 76.1580 | 24.0938 |
| Population mean order value | 73.31 | |
| Corr(frequency, average spend) | -.011 |
Note. Fitted to 493 repeat customers (Fader, Hardie and Lee, 2005). The model assumes spend is independent of frequency; a correlation near zero supports this.
Model check: customers by number of repeat purchases
Top 20 customers by predicted lifetime value
| Customer | Repeat purchases | Recency (weeks) | Age T (weeks) | P(active) | Expected orders (12 mo) | Expected order value | CLV (12 mo) |
|---|---|---|---|---|---|---|---|
| C0449 | 29 | 45.7 | 49.1 | 86.7% | 19.57 | 114.91 | 643.00 |
| C0049 | 39 | 48.1 | 50.9 | 89.3% | 26.08 | 83.05 | 619.33 |
| C0156 | 11 | 29.1 | 30.7 | 91.9% | 11.81 | 156.68 | 529.65 |
| C0294 | 28 | 61.1 | 66.1 | 84.4% | 14.74 | 121.26 | 510.92 |
| C0286 | 24 | 62.6 | 67.0 | 88.7% | 13.28 | 125.52 | 476.33 |
| C0022 | 69 | 72.7 | 74.0 | 97.1% | 37.09 | 44.30 | 469.50 |
| C0498 | 67 | 72.0 | 73.9 | 95.3% | 35.42 | 44.05 | 445.92 |
| C0103 | 5 | 30.3 | 31.0 | 90.6% | 6.07 | 249.49 | 433.04 |
| C0060 | 33 | 66.9 | 73.9 | 68.9% | 12.92 | 108.83 | 401.85 |
| C0370 | 19 | 59.7 | 59.7 | 96.9% | 12.74 | 106.64 | 388.30 |
| C0011 | 22 | 49.3 | 49.9 | 96.5% | 16.62 | 77.75 | 369.64 |
| C0134 | 35 | 81.0 | 81.6 | 97.7% | 17.91 | 72.09 | 368.84 |
| C0404 | 13 | 29.9 | 34.1 | 81.8% | 11.35 | 112.13 | 364.26 |
| C0334 | 25 | 74.1 | 76.4 | 95.0% | 13.32 | 89.74 | 341.59 |
| C0452 | 15 | 78.9 | 82.3 | 93.0% | 7.66 | 153.22 | 335.31 |
| C0062 | 29 | 66.4 | 71.7 | 84.4% | 14.32 | 76.49 | 312.92 |
| C0317 | 29 | 50.6 | 52.3 | 94.9% | 20.45 | 49.94 | 292.09 |
| C0153 | 18 | 50.9 | 54.3 | 90.6% | 12.17 | 83.90 | 291.90 |
| C0233 | 10 | 27.9 | 28.4 | 93.7% | 11.65 | 87.10 | 290.47 |
| C0388 | 11 | 32.1 | 33.3 | 93.1% | 11.35 | 85.82 | 278.81 |
Note. CLV = Σ over months of expected orders × expected order value × margin (30%), discounted at 10.0% a year.
Share of predicted value by customer decile
Distribution of P(active)
Interpretation
The BG/NBD model expects 1,452 orders from these 520 customers over the next 12 months. Active customers buy at an average rate of 0.92 orders a month, and after each purchase there is on average a 16.4% chance that a customer becomes inactive. Total predicted 12-month value is 29,616 (30% margin, discounted), and the top 20% of customers account for 73.6% of it. 53.3% of customers have less than a 50% chance of still being active, a natural target list for win-back.
How to cite this tool
Using these results in a thesis, journal article, report or class assignment? Please cite this free tool so others can find it. It keeps the site free.
APA 7
Xavier, B. (2026). Customer Lifetime Value (BG/NBD and Gamma-Gamma) [Web application]. FreeStatisticalTools.com. https://freestatisticaltools.com/customer-lifetime-value-clv/
BibTeX
@software{xavier_clvcalculator_2026,
author = {Xavier, Bibin},
title = {Customer Lifetime Value (BG/NBD and Gamma-Gamma)},
publisher = {FreeStatisticalTools.com},
year = {2026},
url = {https://freestatisticaltools.com/customer-lifetime-value-clv/},
note = {Web application}
}Suggested sentence for your methods section: “The analysis was carried out with the free Customer Lifetime Value (BG/NBD and Gamma-Gamma) tool on FreeStatisticalTools.com (Xavier, 2026).”
What is customer lifetime value?
This customer lifetime value calculator fits the BG/NBD model of purchase frequency and dropout and the Gamma-Gamma model of spend to your transaction data. For every customer it predicts the probability of still being active, expected future orders and a discounted lifetime value for the horizon, margin and discount rate you choose.
When to use customer lifetime value
Use it for non-contractual businesses (online shops, retail, restaurants, apps with in-app purchases) where customers can stop buying at any time without telling you, to predict future purchases and value per customer and to identify customers who have probably churned.
Assumptions
- Customers buy at a steady, individual rate while active (Poisson purchases) and may become inactive after any purchase (BG/NBD).
- Spend per order varies around each customer’s own mean and is independent of purchase frequency (Gamma-Gamma).
- Several orders on the same day count as one purchase; at least a few hundred customers and many repeat buyers give stable estimates.
How to set up your data
One row per order with a customer ID, the order date and optionally the order amount (needed for lifetime value). Use a period long enough to see repeat purchases, ideally a year or more.
Predicting lifetime value in non-contractual businesses
In a subscription business you know when a customer leaves, because they cancel. In most other businesses, such as online shops, retailers, restaurants, travel and apps with in-app purchases, customers simply stop buying without telling you. A customer who has not ordered for three months may have churned, or may just be between purchases. Simple formulas for customer lifetime value (average order value × purchase frequency × lifespan) ignore this uncertainty and treat everyone as average. The probabilistic “Buy ’Til You Die” models solve the problem: from each customer’s purchase history they estimate how often the customer buys while active, the probability that they are still active, and how many purchases they will make in the future.
The BG/NBD model of purchases
The beta-geometric / negative binomial distribution (BG/NBD) model of Fader, Hardie and Lee (2005) makes four simple assumptions:
- While active, a customer makes purchases at random with a personal rate λ (a Poisson process).
- Purchase rates vary across customers following a gamma distribution with parameters r and α.
- After each purchase, the customer may become inactive with a personal probability p.
- Dropout probabilities vary across customers following a beta distribution with parameters a and b.
The model needs only three numbers per customer: frequency x (the number of repeat purchases), recency tx (the time between the first and the last purchase) and age T (the time between the first purchase and the end of the observation period). The four parameters are estimated by maximum likelihood. The model then gives, for each customer, the probability of still being active and the expected number of purchases in any future period. A customer who bought ten times and recently is almost certainly active; one who bought ten times but not for a long time, given their usual pace, has probably left.
The Gamma-Gamma model of spend
To turn purchases into money, the Gamma-Gamma model (Fader, Hardie and Lee, 2005b) describes the value of each transaction. Each customer has an underlying average spend; individual orders vary around it, and average spend varies across customers. The model shrinks each customer’s observed average towards the population mean, more strongly when the customer has few purchases. It is fitted to customers with at least one repeat purchase and assumes that spend is independent of purchase frequency; the tool reports the correlation between the two as a check.
From predictions to customer lifetime value
For each customer, the tool projects expected purchases month by month over the chosen horizon, multiplies them by the expected order value and the profit margin, and discounts each month at the chosen annual rate:
CLV = Σmonth m E[purchases in month m] × E[order value] × margin / (1 + d)m
This is the same calculation as the Python lifetimes library, and the parameters and predictions match it.
Worked example with the built-in data
The example contains 3,775 orders from 520 customers over two years. The BG/NBD parameters are r = 1.31 and α = 6.24 (weeks), so active customers buy on average about 0.21 times a week, or 0.9 times a month, and a = 0.70, b = 3.55, so after each purchase there is on average a 16% chance a customer becomes inactive. The model check chart shows that the predicted number of customers with 0, 1, 2 … repeat purchases closely matches the actual distribution. The Gamma-Gamma model (p = 5.47, q = 6.68, γ = 76.2) gives a population mean order value of about 73; frequency and spend are essentially uncorrelated (r = −.01), which supports the model. Over the next 12 months, with a 30% margin and a 10% annual discount rate, the 520 customers are worth about 29,600 in profit, and the top 20% of customers account for about three quarters (74%) of it. More than half of the customers have less than a 50% chance of still being active.
Preparing your data
- One row per order with a customer ID, the order date and the order amount. Several orders on the same day are combined into one purchase, as in the original model.
- Use at least a year of history, and ideally more, so that repeat behaviour is visible. Include customers acquired throughout the period; the model handles different ages.
- Remove returns, cancellations and internal or test accounts. For very large customers (B2B accounts), consider modelling them separately.
- Weeks are a good time unit for most retail data; use days for very frequent purchases.
- The end of the observation period defaults to the last order date; set it to the extraction date if the data stop earlier than that.
Using the results
- Targeting: send win-back offers to valuable customers whose P(active) has fallen, and avoid spending on customers who are almost certainly gone.
- Acquisition budgets: compare the predicted value of customers acquired through different channels or campaigns to set how much you can afford to pay for a new customer.
- Forecasting: total expected orders over the next months gives a bottom-up demand forecast for the existing customer base.
- Service levels: treat high-CLV customers differently in support and loyalty programmes.
Download the predictions for all customers to use these figures in your CRM.
Checking and validating the model
Look first at the model check chart: large differences between actual and expected counts mean the assumptions do not fit, for example because of strong seasonality, a subscription component or a big promotion. A stronger test is a holdout: set the end of the observation period a few months before the end of the data, compare the predicted purchases with what actually happened in those months, and then refit on all data. If predictions are reasonable, the model is fit for planning.
Limitations
- The model assumes stable behaviour; it does not include marketing actions, seasonality or customer characteristics.
- It is designed for non-contractual settings with discrete purchases. For subscriptions with observed cancellations, survival models such as Kaplan-Meier or Cox regression are better.
- Predictions for customers with only one purchase rely heavily on the population averages.
- CLV depends on the margin and discount rate you enter; report them with the results.
Reporting
Report the data period, the number of customers and orders, the model parameters, the model check, and the CLV horizon, margin and discount rate. Example: “A BG/NBD model (r = 1.313, α = 6.238, a = 0.695, b = 3.551) and a Gamma-Gamma spend model (p = 5.471, q = 6.684, γ = 76.158) were fitted to 520 customers’ purchase histories. Predicted 12-month customer lifetime value (30% margin, 10% annual discount rate) totalled 29,616.”
Key references: Fader, Hardie and Lee (2005), “Counting your customers the easy way”, Marketing Science; Fader and Hardie (2013), “The Gamma-Gamma model of monetary value”; Schmittlein, Morrison and Colombo (1987), Management Science.
How to use this tool
- Enter your data. Paste columns from Excel, Google Sheets or SPSS with variable names in the first row, or upload a CSV or Excel file. The example data shows the expected layout.
- Choose the variables. Select the customer id, order date and order amount (for monetary value).
- Set the options. Fill in time unit, end of observation period (optional), prediction horizon (months) and profit margin (%).
- Read the results. Results update automatically. Read the plain-English interpretation, then use Copy table to paste APA-style tables into Word and Copy for the results sentence.
How to report customer lifetime value in APA style
Report the model parameters, the model check chart, total and per-customer predicted value with the horizon, margin and discount rate used.
Frequently asked questions
What is the BG/NBD model?
A “Buy Till You Die” model in which active customers buy at individual Poisson rates and may become inactive after any purchase (Fader, Hardie and Lee, 2005).
What inputs does the model use?
For each customer: frequency (repeat purchases), recency (time between first and last purchase) and age T (time since first purchase).
What does P(active) mean?
The probability that a customer has not yet churned, given how many times and how recently they bought.
What is the Gamma-Gamma model?
A model of average order value that shrinks each customer’s observed average spend towards the population mean, assuming spend is independent of frequency.
How is CLV calculated?
Expected orders in each future month × expected order value × margin, discounted at the chosen annual rate and summed over the horizon.
Do the results match the Python lifetimes library?
Yes. The parameters and predictions match lifetimes’ BetaGeoFitter and GammaGammaFitter.
Related tools
See also
Learn this method step by step in the free course Customer and Marketing Analytics, with exercises and a certificate.
Browse all categories
Data cleaning and preparation · Describe and explore · Compare means · Nonparametric tests · Correlation and regression · Bayesian statistics · Categorical data · Reliability and agreement · Multivariate analysis · Structural equation modeling · Econometrics and time series · Panel data and causal inference · Marketing research · Marketing analytics · Survival, clinical and meta-analysis · Study planning and calculators · PLS-SEM