facebookexperimental / facebookexperimental/Robyn
Robyn Budget Allocator max_budget scenario should scale x_hist_carryover for accurate response simulation
- Langage dominant
- Jupyter Notebook
- Étoiles
- 1.5k
- Forks
- 433
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
## Project Robyn
## Describe issue
Simulated Adstock effect is wrongly calculated in max_budget scenario. The Adstock effect is not changed to reflect this budget change when simulated with a different budget. If I understand the code correctly.
The function [`objective.channel` in `eval_f`](https://github.com/facebookexperimental/Robyn/blob/main/R/R/allocator.R#L883-L891), which [calls `fx_objective.chanel`](https://github.com/facebookexperimental/Robyn/blob/main/R/R/allocator.R#L937-L953) calculates Adstock with: `xAdstocked <- x + mean(x_hist_carryover)`.
is used to calculate the response:
```R
optmResponseUnit <- -eval_f(optmSpendUnit)[["objective.channel"]]
```
https://github.com/facebookexperimental/Robyn/blob/main/R/R/allocator.R#L516
Due to using the mean, the number of weeks simulated does not matter. However, if the budget gets very small, the mean(x_hist_carryover)` part is much bigger than `x`, meaning the whole simulated response is dominated by historical carryover at a different budget level.
## Possible solution
Get the ratio: "mean historical spend" / "weekly budget" and multiply with the Adstock effect to scale the effect.
However, I'm not sure if this is accurate. It might be that the Adstock effect is different at different spend levels though.
## Environment & Robyn version
- Robyn version: 3.11.0
Guide de contribution
Ouvrir le guide de contribution
Évaluation
Cette issue n'a pas encore été évaluée.