btyd icon indicating copy to clipboard operation
btyd copied to clipboard

Add Continuous Time CLV Calculations

Open ColtAllen opened this issue 1 year ago • 1 comments

Unrealistically high CLV estimations have been a common complaint with the legacy lifetimes CLV formulations. I believe these discrepancies are due to calculations being made in discrete rather than continuous time.

Follow this link for a primer on comparing summation to integration,:

https://math.stackexchange.com/questions/2089929/comparing-discrete-sums-and-integrals

Assume in the graphic below that the red line is our customer value function, and integrating over time will give us our total CLV for the customer:

discrete_continuous_time

The bars represent discrete value measurements at regular time intervals. Summing up the area of the bars is essentially what the existing customer_lifetime_value method is doing. However, note the corners of the bars protruding beyond the red line - this will inflate total CLV estimations; the wider the bar, the greater the inflation. This width is fixed to monthly intervals in the current customer_lifetime_value implementation; the freq parameter only reflects the time intervals in which data was aggregated for model training, which is daily for most use cases. In theory training models on weekly or monthly data would improve the accuracy of CLV estimates.

Fortunately continuous-time CLV expressions exist. In addition to accuracy they also have the advantage of summing over the total lifetime of the customer rather than a user-specified time period. However, implementation is model-specific.

An expression for the Pareto-NBD model is provided as equation (2) on page 8 of this paper:

http://brucehardie.com/papers/rfm_clv_2005-02-16.pdf

I've also found implementations for the Beta-Geometric/Beta-Binomial model and a few other models that haven't been added yet to btyd, but none for the BG/NBD model. I'll try reaching out to Fader himself on LinkedIn for assistance on this.

ColtAllen avatar Nov 11 '22 15:11 ColtAllen