> For the complete documentation index, see [llms.txt](https://www.mlcompendium.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.mlcompendium.com/ai-product/life-time-value-ltv.md).

# Life Time Value (LTV)

A customer is worth more than one purchase. The page starts with probabilistic and Bayesian lifetime-value models, then the libraries that implement them, and ends with the classic Pareto/NBD model explained conceptually.

The same notes are in [Survival Analysis](/ai-product/survival-analysis.md).

The modern starting point is probabilistic LTV using churn and neural nets, and Google's code for it is [GitHub Google LTV](https://github.com/google/lifetime_value), the google/lifetime\_value repository. The older statistical line has its own library: [lifetimes](https://github.com/CamDavidsonPilon/lifetimes) is lifetime value in Python. Between the two sits Bayesian Customer Lifetime Values Modeling using PyMC3.

Those libraries rest on the Pareto/NBD model, which the literature explains mostly in mathematics. ![Image 1: site logo](https://stats.stackexchange.com/Content/Sites/stats/Img/icon-48.png?v=6b892b6c384d)**Join Cross Validated**: [Understand Pareto and NBD models](https://stats.stackexchange.com/questions/251506/is-it-possible-to-understand-pareto-nbd-model-conceptually) is the Cross Validated question asking for a simple, conceptual explanation of Pareto/NBD, from someone using the BTYD package to predict when a customer is expected to be back.

The two modeling approaches from the start of the page each have a write-up. Probabilistic LTV using churn and neural nets is <https://towardsdatascience.com/the-paper-a-deep-probabilistic-model-for-customer-lifetime-value-prediction-eb5d61a83ecd>, Maja Pavlovic's run through the neural network architecture and loss function of "A Deep Probabilistic Model for Customer Lifetime Value Prediction". Bayesian Customer Lifetime Values Modeling using PyMC3 is <https://towardsdatascience.com/bayesian-customer-lifetime-values-modeling-using-pymc3-d770676f5c06>, Meraldo Antonio's implementation of BG-NBD, a probabilistic hierarchical model, in PyMC3 to analyze customer purchase behavior.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.mlcompendium.com/ai-product/life-time-value-ltv.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
