# Budget Allocation in PYMC Marketing Mix Modeling

**URL:** <https://discourse.pymc.io/t/budget-allocation-in-pymc-marketing-mix-modeling/15049>\
**Category:** version agnostic\
**Tags:** bug, pymc-marketing\
**Created:** [September 9, 2024, 7:05pm UTC](https://discourse.pymc.io/t/budget-allocation-in-pymc-marketing-mix-modeling/15049 "2024-09-09T19:05:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![VT02](https://avatars.discourse-cdn.com/v4/letter/v/50afbb/32.png) [@VT02](https://discourse.pymc.io/u/VT02)\
**Post date:** [September 9, 2024, 7:05pm UTC](https://discourse.pymc.io/t/budget-allocation-in-pymc-marketing-mix-modeling/15049/1 "2024-09-09T19:05:27Z")

</div>

Hi,

I’m currently working on building a Marketing Mix Model (MMM) using the `pymc-marketing` package (version 0.8). After successfully building the model, I’m now focusing on optimizing budget allocation across various media channels.

Based on some research, I’ve made adjustments to include a `max()` function for optimized budget allocation. In the `allocate_budget_to_maximize_response()` function, I set the budget per unit (e.g., for a total budget of 50 over 10 weeks, I used 5 as the budget). However, when running the allocation, I’m noticing that one channel (Google) receives the maximum budget allocation, while the other channels are assigned minimal amounts.

Here’s an outline of the approach:

- **Total Budget** : 206,250 (2475000 for 12 weeks)
- **Channels** : [Google\_Spend, Bing\_Spend, ASA\_Spend, Facebook\_Spend, TikTok\_Spend, Taboola\_Spend]
- **Initial Budget Split** : Divided equally across all channels
- **Budget Bounds** : Set between a minimum of 1,000 and the total budget for each channel.

Despite these settings, the budget allocation is heavily skewed towards one channel. Could someone help clarify how the minimum and maximum bounds work and suggest how to achieve a more balanced allocation across channels?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Alfredo\_Delgado](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/alfredo_delgado/32/8033_2.png) [@Alfredo\_Delgado](https://discourse.pymc.io/u/Alfredo_Delgado)\
**Post date:** [September 16, 2024, 7:14am UTC](https://discourse.pymc.io/t/budget-allocation-in-pymc-marketing-mix-modeling/15049/2 "2024-09-16T07:14:24Z")

</div>

Are you setting each channel bounds as (1\_000, 206\_250)? If so, that might be the issue assuming the mROAS for Google\_Spend is relatively higher compared to other channels.

Try to set your upper bounds based on historical spend share per channel + some percentage to provide some flexibility to the allocator or use the saturation point per channel.

---

<div class="post-metadata">

**Author:** ![VT02](https://avatars.discourse-cdn.com/v4/letter/v/50afbb/32.png) [@VT02](https://discourse.pymc.io/u/VT02)\
**Post date:** [September 17, 2024, 3:09pm UTC](https://discourse.pymc.io/t/budget-allocation-in-pymc-marketing-mix-modeling/15049/3 "2024-09-17T15:09:28Z")

</div>

@Alfredo_Delgado - Thank you for your response. I’ve also tried setting the upper bound based on historical spend, but regardless of any adjustments, the Google spend consistently hits the maximum limit I set.

---

<div class="post-metadata">

**Author:** ![Jonas](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@Jonas](https://discourse.pymc.io/u/Jonas)\
**Post date:** [November 28, 2024, 3:20pm UTC](https://discourse.pymc.io/t/budget-allocation-in-pymc-marketing-mix-modeling/15049/4 "2024-11-28T15:20:35Z")

</div>

I suppose if Google is simply the best channel in terms of ROAS (low saturation, high coefficient, …) then optimization will max out what it can. In other words, unless the channel is in fact weak, your result is expectable, no?
