# Calibrating an inverse geo test for a PyMC MMM model

**URL:** <https://discourse.pymc.io/t/calibrating-an-inverse-geo-test-for-a-pymc-mmm-model/16252>\
**Category:** version agnostic\
**Tags:** modeling, pymc-marketing\
**Created:** [December 15, 2024, 3:00pm UTC](https://discourse.pymc.io/t/calibrating-an-inverse-geo-test-for-a-pymc-mmm-model/16252 "2024-12-15T15:00:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![A\_Bell](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/a_bell/32/8808_2.png) [@A\_Bell](https://discourse.pymc.io/u/A_Bell)\
**Post date:** [December 15, 2024, 3:00pm UTC](https://discourse.pymc.io/t/calibrating-an-inverse-geo-test-for-a-pymc-mmm-model/16252/1 "2024-12-15T15:00:09Z")

</div>

Hi everyone, 👋

I’m building an MMM model using PyMC and need some help with calibrating an inverse geo test. Not sure if I set this up right, and I’d appreciate any guidance!

**Test details:**

- **Pre-test spend:** $4500/day (whole market)
- **During test:** $1700/day (control geos, which are amost unaffected), $0 (test geos)
- **Result:** Δy = -400 installs in the test vs the control
- **Std deviation:** 5000

Here’s the way I summarized it:

```auto
df_lift_test = pd.DataFrame({
    "channel": "channel_name",
    "x": 1700,
    "delta_x": -1700,
    "delta_y": -400,
    "sigma": 5000
})

```

Does this setup look right for calibrating the impact?

Sorry if this is a basic question - any feedback would be super helpful! 🙏

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![cetagostini](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/cetagostini/32/6967_2.png) [@cetagostini](https://discourse.pymc.io/u/cetagostini)\
**Post date:** [December 18, 2024, 8:18pm UTC](https://discourse.pymc.io/t/calibrating-an-inverse-geo-test-for-a-pymc-mmm-model/16252/2 "2024-12-18T20:18:43Z")

</div>

Hey @A_Bell you may know already but here its a good description.

> [@Can I include lift test start and end date in building pymc marketing prior?](https://discourse.pymc.io/t/can-i-include-lift-test-start-and-end-date-in-building-pymc-marketing-prior/14567/3):
>
> Hey, I came across this, and it really helps – thanks! I’m still curious though: why doesn’t time matter in the model? Like, if I sell sunglasses and run a lift test in December vs. August, the ad effect would probably change because of seasonality, no? How does the model handle that? Would love to hear your thoughts! blush

---

<div class="post-metadata">

**Author:** ![A\_Bell](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/a_bell/32/8808_2.png) [@A\_Bell](https://discourse.pymc.io/u/A_Bell)\
**Post date:** [December 22, 2024, 8:16am UTC](https://discourse.pymc.io/t/calibrating-an-inverse-geo-test-for-a-pymc-mmm-model/16252/3 "2024-12-22T08:16:42Z")

</div>

Hey @cetagostini, thanks! I’ve seen it, but I’m still unsure. My situation is a bit different since it’s inverse- I’ve lowered the budget. So I’m not sure if **x** and **Δx** should be for the entire market or just the test market.

The counterfactual thinking behind geo tests is that we created a test group where the budget was reduced to $0, and a comparable control group where the budget remained at $1700 (their pre-test allocation). So the difference in treatment between test and control is $1700, and it resulted in a -400 change in **y**.

I feel like I need to incorporate that somehow into the model. What do you think? Can you help me understand what to input into the model?

Thanks! BTW- your webinar on MMM was incredibly interesting and insightful, thanks for that!
