Hyperparameter tuning is the part of Marketing Mix Modelling that most practitioners hit without fully understanding why it exists — or why it requires running hundreds or thousands of model iterations just to get a number.
This guide explains what hyperparameters are in the context of Robyn, why tuning is essential for a reliable model, how Nevergrad (Robyn’s optimisation engine) works, and what you should realistically expect in terms of runtime, iteration counts, and the consequences of getting it wrong.
In this guide, you’ll learn the specific parameters that need to be tuned, how the Nevergrad algorithm searches for good values, and what AI-assisted hyperparameter management looks like when the tuning process is handled by the platform rather than the analyst.
What Are Hyperparameters in the Context of Robyn?
In everyday statistical modelling, a model’s parameters are the coefficients it estimates from your data — how much each channel contributes to sales. These are what the model learns.
Hyperparameters are different: they are settings that control how the model learns. They define the shape of the statistical relationships the model is allowed to fit. In Robyn’s case, the most important hyperparameters control two specific phenomena: how advertising effects carry over time, and how advertising returns diminish with increasing spend.
The Three Core Hyperparameter Groups
1. Carry-Over Effect Parameters — Alpha / Theta
These control the Carry-Over Effect: the fact that advertising creates demand not just in the week it runs, but in subsequent weeks as the memory of the ad decays.
- Theta controls the rate of decay. A theta of 0 means all effect is in the current week. A theta of 0.5 means half the remaining effect persists each subsequent week. A theta of 0.8 means a TV campaign from eight weeks ago still has a meaningful effect on this week’s sales.
- Alpha controls the shape of the saturation curve (see below).
2. Saturation Parameters — Alpha / Gamma
These control the point of Diminishing Returns: the observation that each additional pound of advertising spend produces progressively less incremental return as the channel becomes saturated.
- Alpha shapes the steepness of the saturation curve
- Gamma controls the point at which the curve inflects — the spend level where efficiency begins to decline materially
3. Model Fit / Regularisation
- Train size — the proportion of your data used for fitting vs. held out for validation. Robyn typically holds out 20–50% of the data to check that the model generalises.
Robyn requires you to set a range for each hyperparameter, per channel. Nevergrad then searches within those ranges to find the combination that produces the best-fitting model.
Why Tuning Matters: Model Fit vs. Overfitting
The reason hyperparameter tuning is necessary — rather than just fitting a model to your data once — is the Bias-Variance Tradeoff.
Underfitting occurs when the model is too simple: it cannot capture the real patterns in your data. If you set all Carry-Over Effect parameters to zero (assuming no adstock), a TV-heavy advertiser will see their TV contribution severely understated because the model cannot account for delayed effects.
Overfitting occurs when the model is too complex: it fits the noise in your historical data rather than the underlying signal. An overfitted model will show excellent performance on past data but produce unreliable estimates for future periods.
Ridge regression — the method Robyn uses — is specifically designed to reduce overfitting by penalising large coefficient values. But the hyperparameters still need to be searched across, because an incorrectly configured Carry-Over Effect or saturation function can produce outputs that are systematically biased regardless of how well the ridge penalty is applied.
A model with a TV theta range set to 0–0.1 (implying almost no Carry-Over Effect) will systematically under-attribute all long-run brand channel contribution, regardless of other parameter values. The model will fit reasonably well statistically — it will just be wrong about TV.
How Nevergrad Works: Why It Requires Hundreds of Iterations
Nevergrad is Facebook Research’s open-source library for black-box optimisation. It’s called “black-box” because it doesn’t require the objective function (in this case, MMM model quality) to have a known mathematical formula. It explores the parameter space empirically — trying different combinations, observing the quality of the result, and using that information to guide its next search.
The specific algorithm Robyn uses is a form of evolutionary computation: it maintains a population of candidate parameter sets, evaluates their quality, selects the better-performing ones, and generates new candidates by combining or mutating them.
Here’s why this requires hundreds of iterations rather than one:
- The parameter space is high-dimensional. With three channels and three hyperparameters each (alpha, gamma, theta), you have nine parameters to optimise simultaneously. The number of possible combinations is astronomically large.
- The objective landscape is not smooth. Small changes in one hyperparameter can produce non-linear changes in model quality. There’s no simple formula that tells Nevergrad where the optimal point is; it has to discover it through exploration.
- You need to distinguish signal from noise. Even a good parameter set might produce a slightly worse model quality score on one run due to random variation in the training data split. Running many iterations ensures you find settings that are consistently good, not just lucky.
In practice, Robyn’s default configuration runs 2,000 iterations across 5 independent trials (10,000 total model evaluations) for a moderately complex dataset. The full run takes 20–60 minutes on typical hardware.
Practical Tips for Setting Iteration Counts and Runtime Expectations
Minimum Viable vs. Production Configuration
| Use Case | Iterations | Trials | Approx. Runtime |
|---|---|---|---|
| Rapid exploration / first run | 500–1,000 | 3 | 5–20 minutes |
| Standard analysis | 2,000 | 5 | 20–60 minutes |
| Production / high-confidence output | 5,000–10,000 | 5 | 1–4 hours |
More iterations generally produce more stable and reliable results. The law of Diminishing Returns applies here too: going from 500 to 2,000 iterations produces substantial improvements in model stability; going from 10,000 to 20,000 produces marginal gains.
Setting Realistic Hyperparameter Ranges
Ranges that are too narrow constrain the model unnecessarily. Ranges that are too wide slow down convergence.
Channel-type guidelines for theta (Carry-Over Effect):
| Channel Type | Theta Range Suggestion |
|---|---|
| Paid search (branded / exact) | 0.0 – 0.3 |
| Paid social / display | 0.1 – 0.5 |
| YouTube / video | 0.2 – 0.6 |
| Radio | 0.3 – 0.6 |
| TV | 0.3 – 0.8 |
| Out-of-home / print | 0.3 – 0.7 |
These are starting points, not rules. Adjust based on your knowledge of the channel and review the model’s selected values after each run.
The Cost of Getting Tuning Wrong
Incorrect hyperparameter configuration is the most common reason for MMM outputs that look statistically acceptable but are strategically misleading.
Under-attributing brand channels. If TV and video Carry-Over Effect parameters are set too low, the model sees most TV spend as having no effect beyond the week it ran. TV contribution estimates will be systematically understated. A client using these results will underinvest in brand channels and over-rely on direct-response.
Over-attributing saturated channels. If saturation parameters (gamma) are set too high, the model assumes channels aren’t anywhere near Diminishing Returns — even when they are. Budget recommendations will suggest scaling a channel past its efficient operating range.
Inconsistent model selection. If hyperparameter ranges are very wide and iteration counts are low, Nevergrad may not converge reliably. Different runs of the same model with the same data will produce different Pareto fronts, making it hard to compare results or build a consistent model series over time.
What Managed Hyperparameter Defaults Look Like in Practice
The challenge with manual hyperparameter configuration is that setting good ranges requires prior knowledge of how each channel behaves — knowledge that varies by industry, brand maturity, and media market. First-time Robyn users frequently set ranges that are too conservative or too wide, resulting in a first run that either misses the best model or takes much longer than necessary.
Managed MMM platforms handle hyperparameter initialisation by applying channel-type defaults informed by MMM practitioner experience across many model runs. When you configure a channel as “Paid Search” or “TV,” the platform starts with sensible parameter ranges for that channel type and adjusts based on your data characteristics.
This doesn’t remove the analyst’s responsibility to sanity-check the outputs — that’s never automated away. But it eliminates the blank-canvas problem that causes most first-run Robyn configurations to produce suboptimal results.
The optimisation process itself (Nevergrad running thousands of iterations) runs on cloud infrastructure, which means you’re not waiting for your laptop to complete a four-hour run.
Frequently Asked Questions
What are hyperparameters in marketing mix modelling?
In MMM, hyperparameters are settings that control how the model represents advertising effects — specifically, how long advertising effects persist over time (Carry-Over Effect) and how quickly returns diminish as spend increases (saturation). Unlike the model’s channel contribution estimates (which are calculated from your data), hyperparameters define the mathematical structure within which the model fits. They must be configured before the model runs.
What is Nevergrad and why does Robyn use it?
Nevergrad is Facebook Research’s open-source black-box optimisation library. Robyn uses it to search for the best hyperparameter combination across thousands of candidate configurations. Because MMM hyperparameters cannot be optimised analytically, Nevergrad uses evolutionary computation to explore the parameter space empirically, evaluating the fitness of each candidate and using the results to guide subsequent searches.
How many iterations does Robyn MMM need?
For a standard analysis with 3–5 media channels, 2,000 iterations across 5 trials is a reasonable production configuration. Exploratory runs can use 500–1,000 iterations for speed. Higher-stakes analyses or datasets with many channels benefit from 5,000–10,000+ iterations, though the marginal improvement in model stability decreases beyond this range.
What happens if I set hyperparameter ranges incorrectly?
If ranges are too narrow, the model is constrained to a suboptimal region of the parameter space — it may produce outputs that look statistically acceptable but misattribute channel contributions. Most commonly, incorrect Carry-Over Effect (theta) ranges lead to systematic under-attribution of brand channels like TV. If ranges are too wide, Nevergrad converges more slowly and the model run takes longer without necessarily producing better results.
Can I automate Robyn hyperparameter tuning?
Robyn’s Nevergrad integration automates the search within the ranges you specify — this is what Nevergrad does. What you cannot automate (using raw Robyn in R) is the initial range-setting, which requires practitioner judgement. Managed MMM platforms apply pre-configured default ranges by channel type, reducing the manual configuration step while still running the same Nevergrad search process under the hood.
Run Your Model With Managed Hyperparameter Defaults
If you’re spending more time on hyperparameter configuration than on interpreting your results, the tooling might not be working for you.
MMM Pilot applies channel-type hyperparameter defaults informed by practitioner experience, runs the Nevergrad optimisation on cloud infrastructure, and delivers the same Robyn outputs without the configuration overhead. You review results and sanity-check the outputs — the tuning happens automatically.

