Inconsistency in repo budget allocation example

The mmm example case study here MMM End-to-End Case Study — Open Source Marketing Analytics Solution

passes weekly budget divided by the number of channels to mmm.optimize_budget. Why? The documentation for that function states that budget = The total budget to be allocated. Wouldn’t dividing by the number channels misrepresent the total budget? What does “The total budget to be allocated” actually mean? Total across all channels? Across a single channel?

# Weekly budget for each channel
# We are assuming we do not know the total budget allocation in advance
# so this would be the naive "uniform" allocation.
per_channel_weekly_budget = all_budget / (num_periods * len(channel_columns))
model_granularity = "weekly"
allocation_strategy, optimization_result = mmm.optimize_budget(
    budget=per_channel_weekly_budget,
    num_periods=num_periods,
    budget_bounds=budget_bounds,
    minimize_kwargs={
        "method": "SLSQP",
        "options": {"ftol": 1e-9, "maxiter": 5_000},
    },
)

CC @cetagostini

Anyone else have additional insight into this? Would love to know what I’m missing here. Thanks!

Hey @fountainpen

budget is the total budget per unit of time. If your model is weekly then will be weekly budget, probably the per_channel in the per_channel_weekly_budget was a typo. We’ll solve it, asap!

Thanks for the catch!

2 Likes