Skip to main content

Budget allocation with Markov model

Import libraries


Set the password


Load data

Data = read.csv("",sep=",")

Set the total budget you want to allocate


Set the percentage of the budget you want to reallocate from your previous allocation

The parameter can be set in the range (0,1]. Setting it to 0.1 means that you will reallocate the 10% of your previous allocation. Drastic changes in your previous allocation are not suggested because the allocation algorithm is based on ROI and thus it is a local optimization algorithm. We suggest to reallocate a small percentage each time


For each channel indicate its marketing spend

This parameter is optional. If you do not know the marketing spends you can set it to NULL


Perform attribution with Markov model

var_value and var_null are optional and can be set to NULL if you do not have this information

res_markov=markov_model(Data, var_path="path", var_conv="total_conversions", var_value="total_conversion_value", row_sep=";", cha_sep=">", password=password)

Perform budget allocation