Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jdmaturen/shifted_beta_geometric_py
An implementation of the shifted-beta-geometric (sBG) model from Fader and Hardie's "How to Project Customer Retention" (2006)
https://github.com/jdmaturen/shifted_beta_geometric_py
customer-retention fader hardie numpy python sbg scipy
Last synced: about 2 months ago
JSON representation
An implementation of the shifted-beta-geometric (sBG) model from Fader and Hardie's "How to Project Customer Retention" (2006)
- Host: GitHub
- URL: https://github.com/jdmaturen/shifted_beta_geometric_py
- Owner: jdmaturen
- License: apache-2.0
- Created: 2013-10-14T17:39:05.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2020-10-25T00:27:05.000Z (about 4 years ago)
- Last Synced: 2024-10-31T08:42:04.892Z (about 2 months ago)
- Topics: customer-retention, fader, hardie, numpy, python, sbg, scipy
- Language: Python
- Size: 121 KB
- Stars: 56
- Watchers: 2
- Forks: 21
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sBG model of customer retention
A python implementation of the shifted-beta-geometric (sBG) model from Fader and Hardie's ["How to Project Customer
Retention" (2006)](http://www.brucehardie.com/papers/021/sbg_2006-05-30.pdf).Important note to modelers: amongst other presumptions, see §3 of the paper, sBG is only applicable to discrete,
contractual customer relationships:Figure Source: ["Probability Models for Customer-Base Analysis" (Fader and Hardie 2009)](https://marketing.wharton.upenn.edu/files/?whdmsaction=public:main.file&fileID=341)
## Example
```python
from shifted_beta_geometric import derl, fit, predicted_survival# measured percentage of cohort that survives over time
example_data = [.869, .743, .653, .593, .551, .517, .491]# fit our observed data to the sBG model, which returns the parameters alpha and beta
alpha, beta = fit(example_data)# predict the next 5 time samples:
future = predicted_survival(alpha, beta, len(example_data) + 5)[-5:]# future = [0.460, 0.436, 0.414, 0.395, 0.378]
# compute the discounted expected residual lifetime (DERL) for the survivors
# of this cohort at point in time t:
discount = 0.10 # rate at which we discount future revenue
# to get value in today's terms, e.g. 10%/year
t = len(example_data)
residual_cohort_lifetime = derl(alpha, beta, discount, t)# residual_cohort_lifetime = 7.530
# if our average revenue per period per customer is a constant v_avg,
# to get the residual customer lifetime value (CLV) of this cohort
# we simply multiply the residual_cohort_lifetime by v_avg:v_avg = 10
residual_cohort_clv = residual_cohort_lifetime * v_avg# thus residual_cohort_clv = $75.30 per customer in this cohort
```## Requirements
sBG requires `numpy` and `scipy` for fitting and the gauss hypergeometric function.