expected_customer_lifetime_value
returns NaN for large customers / long horizons (BG/NBD + Gamma-Gamma)
#1914
haseeb1431
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I’m fitting a BetaGeoModel + GammaGammaModel for different size of customer datasets we calculate CLV projections over 10 to 15 years. It has been working fine until we got a dataset where we start to get NaN for CLV. Everything looks fine for short horizons (1–3 years), but when I call
expected_customer_lifetime_value
with longer horizons (≥ 4–5 years) I start getting NaN CLV values for some customers.As I understood, it was happening due to larger monetary values so I have tried to use lograthmic or scaled down the values but still continue to get null CLV values. The following is a sample output for a scaled down monetary value.
Example output:
Observations:
Scaling monetary_value helps avoid immediate overflow, but NaN still appears for high-frequency/high-spend customers after a few years. Looks like the closed-form expectation formula inside expected_customer_lifetime_value overflows with extreme parameter/posterior values, even though a Monte Carlo simulation would still yield finite numbers.
Steps to Reproduce
Expected behavior
Return finite (though large) CLV values, even for high-frequency / high-spend customers. At minimum, gracefully warn about overflow instead of returning NaN.
Questions
Beta Was this translation helpful? Give feedback.
All reactions