bayesian inference DRM model
Based on the Uber "Improve User Retention with Causal Learning" we estimate a "Direct Ranking Model" DRM for a promotion problem using a Bayesian inference model of the heterogeneous treatment effects. We build a simulated dataset and write a simple routine to find the original parameters and create an inferred ranking.
This model was created with the excuse of applying some contents from the book "Bayesian Methods for Hackers" and the course "Statistical Thinking" this is not a real problem, and it was built just with the purpose of learning, however, it's a very common problem in the marketing industry.
In Uber's publication they propose an optimization problem about maximizing the total return
The Stardust
coffee shop is a massive coffee chain that has a loyalty program where each costumer has a card that they can use to buy in the store. The Stardust
loyalty program has a benefit that if you have the Stardust Wallet
you are eligible for exclusive promotions. These promotions are part of the Marketing budget and their main focus is to maximize the costumers' demand
In order to measure the performance of their campaigns' week by week Stardust
randomly select two groups of clients and gave a promotion to one of them (an A/B test). They estimate that the return from the campaign will be given by the ATE from the "Potential Outcomes Model" given that this is a controlled randomized experiment, therefore we hold the independence assumption, we can estimate that the incremental demand of the promotion from:
if we divide this Stardust
coffee shop was already capable of improving and testing with different mechanics; different discounts or different conditions such as "valid for X amount of beverages". although all this improvement with different campaigns, they where more interested in targeting their discounts to certain costumers that might lead to a better ROI
, they where particularly concern about if they target their promotions better they might optimize the ROI
of the campaign.
The main hypothesis that the Stardust
shop has is that there is a "costumer ROI
" that can be estimated based on the historical discounts and after that they might target the costumers with the higher ROI
and maximize then the campaign ROI
, we probably don't know what is that number, but we might be able to infer it using bayesian inference
The problem from Stardust
resembles a lot the problem exposed in the paper, we will, therefore, use a very similar model. Let's assume that the costumer demand
$$Y_{i}(D) = \tau^{i}{d}*D + \tau^{i}{0}$$
Basically, we have the simplest way of describing the demand of the costumer
We can estimate the client ROI
using that formula by simply applying:
$$ ROI_{i} = \frac{Y_{i}(D) - Y_{i}(0)}{D} = \frac{\tau^{i}{d}*D + \tau^{i}{0} - \tau^{i}{d}*0 - \tau^{i}{0}}{D} = \tau^{i}_{d} $$
So basically our ROI_i
will be represented by tau_i
(
where our
and the parameters priors will be given by (example)
The campaign ROI
then will be given by:
Which is an observable variable (this is useful for the validation of the running experiment), but given that we assume full information from the payment method we will not need it as a fitting parameter.
To simulate our data we use the following spent formula:
$$Y_{i}(D) = truncnormal(a, b, \mu_{i} = \tau^{i}{d}*D{i} + \tau^{i}{0})* \mathbb{1}{truncnormal(D)>trunc_val} $$
where truncnormal
distribution (respectively). we define those limits as a = 0
, b = 30
which will meant that the weekly billings will be between $0 USD
to $30 USD
. Then we only keep the values where the spend is higher than a min threshold for the billing amount (this will provide us a 0 inflated interval). Finally, the spend results are plotted in the following figure: