One of the most common applications in AI/ML is allocation, Marketing expenditure, supply, labor?
Today's post is focused Marketing Mix Modeling (MMM)Method Data Science Team uses it to effectively allocate marketing budgets.
The goals of today's posts will help you understand how MMM works and you can apply that principle to other assignment challenges.
As the person responsible for allocating marketing spending, you face several challenges.
- A rising budget means misallocation is more expensive than ever
- Multi-channel campaigns create overlapping effects, making it difficult to identify which channels really drive the lift
- Finance wants clarity in ROI, and current approaches cannot stand under scrutiny
The current approach relies heavily on heuristics. For example, Jane sees a TV ad, clicks on an Instagram ad, opens a promotional email, and eventually purchases through paid search ads. use Attribution of the last touch, I only praise paid searches, but it underestimates support from television and email.
To improve decision-making, we asked our Data Science team to build a Marketing Mix Modeling (MMM) solution to help with answers.
- What are the contributions to sales of each channel?
- How does ROI change with more or less spending?
- How do external factors affect seasonality, promotions and competition affect sales?
- (Later post) What is the best spending mix?
In this post, we will focus on how to build an MMM solution that answers the first three questions. Optimization is covered in follow-up.
Step 1: Define the right Y variable
Not only are they forecasting sales, they are also targeting the next target.
- Basic sales (assuming there is no marketing expenditure)
- Television contributions
- Search for contributions
- Total forecast sales
Product x Market x Weekly Level Models for Practical Insights.
Step 2: Understand the business context
Before modeling, you need to discover and understand
- When and how will expenditures be allocated?
- How are each channel designed to trigger sales?
- How are campaigns and promotions designed with channel strategies in mind?
- What beliefs already exist about marketing spending and ROI?
Step 3: Develop a hypothesis tree
Before building a model, it is essential to investigate whether separate models are required for product x domains, whether features differ depending on them, and whether interaction effects exist.
Hypothesis testing can help clarify these needs. Below is a summary of key hypotheses, insights and consequent decisions
Step 4: Set up the dataset for hypothesis testing and modeling
Here is a list of variables that must be expressed in some way in the dataset:
- Sales or revenue, alias Y Target variable
- Media expenditures per channel (TV, search, social, etc.)
- Promotions and Discounts
- Holidays and seasonality
- Pricing
- Product availability
- Competitor data (if available)
Step 5: Select a model
There are two models to consider
Ridge Return
- Great baseline, fast and transparent
- Handles many correlated features
- Easy to explain to stakeholders
Bayesian Regression (Industry Standard)
- Provides uncertainty intervals (optimized for finance/executives)
- Built-in support for lag (adstock) and saturation
- Share learning across markets/products with hierarchical modeling
Step #6 – Set the Bayesian model
structure: The setup mirrors the standard ML approach
- Goal (Y): Typically weekly sales or revenue.
- Independent variable (x):
- Media expenditure: TV, search, social, etc.
- Controls: Promotion, holidays, pricing, seasonality, etc.
Features are converted to mirror real world behavior
Advertising stock (delay impact): Used in the model and the impact of the ads may appear over time
- A particular approach is to use damping rates to distribute the effects of AD expenditure over the next few weeks.
- example– 1st week TV = $100, Advertising stock price = 0.5
- Total perceptual effect = $100 + $50 + $25 = $175 (spreads over several weeks)
- What this means is that spending $100 could have a total impact of $175. It's not about actual spending, but how the model perceives and spreads the effect.
Saturation (reduced return): This is used to model the reduced effectiveness of AD expenditures at higher levels.
Specific approaches include nonlinear transformations, i.e., applying logs or S-curves, indicating that the effect of the additional dollars is less effective as you spend more.
Model learning:
- Assign a coefficient to each variable.
- Learn by simulating many parameter combinations to find the best fit
What is the output of the model??
- Range (95% CI): The model estimates that there is a 95% chance of a true value within this interval.
- Point Estimation: Median prediction range.
- Total sales: Projected sales compared to experiments.
- Basic sales: Sales expected to have zero marketing spending, alias Y intercept
- Channel contribution: Indicates how much each channel adds to total sales, such as TV, paid searches.
- Control Variables: Although not always shown, the model also estimates the impact range (i.e. $15,000 to $25,000) for controls such as promotions.
Step 7: Validate the model using backtest
- Use point estimation to assess accuracy. Use metrics like Wape to compare total sales forecasts and actual sales
- You can use ranges to calculate how often the actual frequency fell within the predicted range
- You can also calculate the range width to see if it's sufficient
To assess how well a model works with invisible data, we simulate real scenarios through backtesting.
- Training and testing historical data:
- Train Bayesian MMM using data from the first three years (IE, 2019 – Q2 2023).
- Test in Q3 and then retrain and test in Q4 2023 to verify accuracy
- Then score in all 2024
2. Simulate future forecasts:
- Starting in the first week of 2024
- Every week in 2024, we make predictions using only historical data up to that point in time.
- This process will be repeated weekly this year and retrained quarterly.
3. Compare with the actual one:
- Compare your forecasted sales with actual sales each week.
- Don't forget to track points estimate accuracy, range accuracy, range average width, and other related metrics.
