facebookexperimental / Robyn

Robyn is an experimental, AI/ML-powered and open sourced Marketing Mix Modeling (MMM) package from Meta Marketing Science. Our mission is to democratise modeling knowledge, inspire the industry through innovation, reduce human bias in the modeling process & build a strong open source marketing science community.
https://facebookexperimental.github.io/Robyn/
MIT License
1.13k stars 333 forks source link

Budget allocator - Bounded spend is not matching with initial or new given spend in the input #1017

Open CJ2407 opened 2 months ago

CJ2407 commented 2 months ago

Project Robyn

Describe issue

I wanted to run two scenarios - 1) base scenario with NULL spend i.e. 6.3MM initial spend and 2) new budget scenario with initial+$971,510 for a date range date_range = c("2023-08-03", "2023-09-02"). When I ran scenario 2, I am getting bounded spend which is only $100K higher than initial spend and unbounded spend is coming out correctly as desired i.e. initial + $971,510. I don't understand why bounded spend is so random?

Provide reproducible example

4_61_27_reallocated_best_roas

`AllocatorCollect <- robyn_allocator(

InputCollect = InputCollect,

OutputCollect = OutputCollect,

json_file = json_file, dt_input = input_data, dt_holidays = dt_prophet_holidays, select_model = "4_61_27", date_range = c("2023-08-03", "2023-09-02"), # Default last month as initial period total_budget = 7290763, # When NULL, default is total spend in date_range channel_constr_low = c(1, 1, 1, 1, 1, 1, 0.8, 0.8, 0.8, 0.8,0.8, 0.8, 0.8, 0.8, 0.8,0.8, 0.8, 0.8, 0.8, 0.8,0.8, 0.8, 0.8, 0.8, 0.8,0.8, 0.8, 0.8, 0.8), channel_constr_up = c(1, 1, 1, 1, 1, 1, 1.2, 1.2, 1.2, 1.2,1.2, 1.2, 1.2, 1.2, 1.2,1.2, 1.2, 1.2, 1.2, 1.2,1.2, 1.2, 1.2, 1.2, 1.2,1.2, 1.2, 1.2, 1.2), channel_constr_multiplier = 3, scenario = "max_response", export = TRUE )`

Environment & Robyn version

Robyn version 3.10

jameslei23 commented 1 month ago

I guess the parameter "channel_constr_low" and "channel_constr_up" is not consistent with the ttl budget uplift(+$971,510). For example, you can calculate if it's correct: channel_A_SPD(1.2-1)+channel_B_SPD(1.2-1)+...+channel_N_SPD*(1.2-1) = 100k<971,510