CRM Analytics: CLTV (Customer Lifetime Value)

zeynep beyza ayman
The Modern Scientist
6 min readOct 31, 2022

I’m here again with a different title in CRM Analytics. In my previous article, I introduced CRM Analytics with RFM analysis. I made comments on segments of our customers and how we should take action to return or keep them. If you haven’t read it, I suggest you read it first:

Long story short, CRM analytics can be defined as a set of data-based studies to make the relationships between companies and customers more efficient. Customers are divided into segments and actions are taken according to these segments. By learning customers' purchasing habits, strategies can be determined and studies can be carried out for both customer loyalty and company profitability.

We will work with the same dataset again. Let’s take a look at the dataset:

Description of Dataset:

Online Retail II data set contains all the transactions occurring for a UK-based and registered, non-store online retail between 01/12/2009 and 09/12/2011. The company mainly sells unique all-occasion giftware. Many customers of the company are wholesalers. you can access more information about the data set from here

Attribute Information:

  • Invoice: Invoice number. Nominal. A 6-digit integral number uniquely assigned to each transaction. If this code starts with the letter ‘C’, it indicates a cancellation.
  • StockCode: Product (item) code. Nominal. A 5-digit integral number uniquely assigned to each distinct product.
  • Description: Product (item) name. Nominal.
  • Quantity: The quantities of each product (item) per transaction. Numeric.
  • InvoiceDate: Invoice date and time. Numeric. The day and time when a transaction was generated.
  • UnitPrice: Unit price. Numeric. Product price per unit in sterling (£).
  • CustomerID: Customer number. Nominal. A 5-digit integral number uniquely assigned to each customer.
  • Country: Country name. Nominal. The name of the country where a customer resides.

CLTV : Customer Lifetime Value

CLTV is the monetary value a customer brings to a company during the interaction with that company. First thing first we should answer why CLTV is important to us; if we can determine the profit that our customers will provide us in the future, we can both regulate our relationship with them and create a more customer-oriented and more value-added approach in our company in the medium-long term.

The CLTV metric can provide insight into customers’ loyalty to the company, thereby enabling more informed sales and marketing decisions. As a result, companies can improve customer retention. Considering that it is more costly to acquire new customers, the importance of CLTV can be grasped again at this point.

Calculating CLTV

Calculating and predicting the CLTV value are different things. In this topic, we will calculate the CLTV value, which can be considered as a partial prediction, but since there is no time projection, it will not provide a broad perspective for the future. However, it will still be very valuable for determining the values of existing customers.

In the next topic, we will talk about CLTV prediction then you can better understand the difference between CLTV calculation and prediction.

Now let's focus on calculating the CLTV value. You will see that there is a bunch of equations to calculate CLTV. But don’t let that scare you, because we’re going to focus on:

  • CLTV = (Customer Value / Churn Rate) * Profit Margin

The following equations are used to reach this equation.

  • Customer Value = Average Order Value * Purchase Frequency
  • Average Order Value = Total Price / Total Transaction
  • Purchase Frequency = Total Transaction / Total Number of Customer
  • Churn Rate = 1- Repeat Rate
  • Repeat Rate = Number of Customers Making Multiple Purchases / Total Number of Customers
  • Profit Margin = Total Price * 0.10 (0.10 is constant and depends on the company)

Note that CLTV is based on “customer value” and “total price” is the most influential element in the CLTV calculation.

Calculation of CLTV

CLTV Prediction

In the previous section, we learned about Customer Lifetime Value and performed its calculation in Python. And again, as I mentioned in the previous section, there is a prediction of CLTV with time projection. In the CLTV prediction, the purchasing behaviour of the customers and the profit per transaction of customers will be modelled probabilistically. the characteristics of a customer on this probabilistic model, a prediction process will be made based on general customer behaviours.

Let’s dwell on prediction metrics and how they are calculated.

Prediction Metrics:

  • Recency: Unlike the recency value in RFM Analysis, it refers to the time elapsed between the customer’s first purchase and the last purchase. It is usually shown on a weekly basis.
  • T: It refers to the time elapsed since the customer’s first purchase, which is the age of the customer in the firm. It is usually shown on a weekly basis.
  • Frequency: the number of repeat transactions of the customer. (frequency > 1)
  • Monetary: average profit per transaction
  • CLTV = Conditional Expected Number of Transaction * Conditional Expected Average Profit
  • CLTV = BG / NBD Model * Gamma Gamma Submodel

BG/NBD Model:

With this model, we will learn about the distribution structure of the transactions of the customers then the average of this probabilistic distribution will be shaped based on customers, and the expected number of transactions for each customer will be predicted.

The BG/NBD model is used as a prediction model on its own: “Buy Till You Die.”

  • Transaction Process (Buy):

the number of transactions to be performed by a customer in a given time period is Poisson distributed with the transaction rate parameter. As long as a customer is alive, they will continue to make random purchases around their transaction rate. Transaction rates vary for each customer and are gamma-gamma dispersed for all customers. Inferences and predictions can be made over a population whose distribution you know. If I know the general distribution of a customer base, conditionally reducing it to a customer’s specifics, I can predict how many purchases that customer might make.

  • Dropout Process (Till You Die):

Each customer has a dropout (churn) rate with probability p. Dropout rates vary for each customer and are beta-distributed for all customers.

equation of BG/NBD
  • x : number of repeated purchases
  • tx : the difference between the first and last purchase for the customer
  • T : time since a customer’s first purchase, age of the customer
  • r and α : the parameters of the gamma distribution which model transaction rate
  • a and b : parameters of beta distribution which model dropout rates

So far we predicted expected purchases, now we need to estimate the expected profit of these transactions with the Gamma Gamma Submodel.

Gamma Gamma Submodel

Gamma Gamma Submodel is used to estimate the average profit per transaction for a customer. The monetary value of a customer’s transactions is randomly distributed around the average of the transaction values. The average transaction value may change between customers over time, but not for a single customer. The average transaction value is gamma distributed among all customers.

equation of Gamma-Gamma
  • x : customer frequency
  • mx : customer’s monetary
  • p, q and γ : Gamma distribution parameters

CLTV Prediction with BG-NBD and Gamma-Gamma

When we combine the BG-NBD model and the Gamma Gamma submodel, then we will have a CLTV calculation based on the predictions obtained by considering both profitability and purchase over a given time period.

You probably think how such high recency could give the highest clv? Because the concept of “Buy Till You Die” refers that if your customer with a regular average transaction does not churn, the probability of purchasing increases at the customer’s recency increases.

Customer Segmentation According to CLTV

descriptive analytics of the customer segments
bar plot of the mean of the segments

Details of the code:

We have reached the end! Got questions, got stuck or just want to say hi? kindly use the comment box.🦖

--

--