CUPED & ratio metrics
Not a calculator. Two things that go wrong once your metric stops being a simple conversion rate, and one technique that is worth more than most of the experiments you will run this quarter.
1. Variance reduction: buying traffic you do not have
Every calculator in this suite tells you the same depressing thing: you need more users than you have. There is one honest way around it that does not involve lowering your standards, and it is that a great deal of the variation you are fighting was already there before the experiment started. Heavy users were heavy users last month too. If you know that, you can subtract it.
That is CUPED. Take a covariate X measured
before the experiment, and analyse an adjusted metric instead of the
raw one:
Y_cv = Y − θ(X − E[X]) where
θ = cov(Y, X) / var(X)
The variance of the adjusted metric is var(Y) × (1 − ρ²),
where ρ is the correlation between the covariate and the metric. Drag it:
- rho--
- traffic--
- days--
Slider positions live in the URL.
What it is worth, on real metrics
The numbers people quote for CUPED come from Bing, in the paper that introduced it, and they are worth knowing because they are so uneven:
| Metric | Variance reduction | Worth |
|---|---|---|
| Queries per user, two-week pre-period | ~50% | Doubles your traffic |
| Revenue per user | under 5% | Practically nothing |
Revenue is the metric people most want to rescue and the one CUPED helps least, because what someone spent last month predicts what they spend this month far more weakly than you would hope. If a vendor tells you CUPED will fix your revenue test, ask them for the correlation.
2. Ratio metrics: when your standard error is quietly wrong
Here is the trap, and it is not the one people expect. It is not that revenue is skewed. It is that you randomised users and then measured sessions.
Conversion rate per session, revenue per order, click-through per pageview: all of these are ratios whose denominator is not the thing you randomised. Sessions from one user are not independent of each other: a user who converts once tends to convert again. The textbook standard error assumes every session is a fresh, independent draw. It is not, so the standard error comes out too small, and you get confident about effects that are not there.
The fix is the delta method: write the metric as a ratio of per-user averages, so the unit of analysis is the unit you randomised, and propagate the variance through the ratio.
- naiveNaive standard error, sessions treated as independent: —
- deltaDelta method, users as the unit: —
- truthThe truth, from re-running the experiment 300 times: —
Simulating…
What people get wrong
- "Revenue per user needs the delta method." Usually not. If you randomised users and you are measuring a per-user average, every observation is one user and they are independent: an ordinary t-test is structurally correct. The delta method is about the analysis unit differing from the randomisation unit, not about the metric being money.
- "Revenue is too skewed for a t-test." The central limit theorem still applies to the mean of skewed data, just slowly. The usual rule of thumb asks for roughly 355 × (skewness)² observations per arm before the normal approximation is comfortable. Winsorising the tail helps the variance and biases the estimate toward zero, and your outliers are often your best customers, so think before you trim them.
- "CUPED is regression adjustment magic." It is regression adjustment, and there is no magic in it: the gain is exactly ρ² and nothing else. It is equivalent to ANCOVA on the pre-period covariate.
- "Estimate θ separately for each arm." No. Pool it. A per-arm θ is fitted partly to the treatment effect itself, which biases the result.
Sources, and what this page does not cover
- Deng, Xu, Kohavi & Walker, Improving the Sensitivity of Online Controlled Experiments by Utilizing Pre-Experiment Data (WSDM 2013): the CUPED paper. Source of the formulas, the Bing figures and the in-experiment-covariate warning.
- Deng, Knoblich & Lu, Applying the Delta Method in Metric Analytics (KDD 2018): the ratio-metric variance and the rewrite that makes it work.
- Kohavi, Tang & Xu, Trustworthy Online Controlled Experiments (2020), chapters 14, 17 and 18: randomisation units, skewed metrics, variance reduction.
- Microsoft's experimentation platform, Deep Dive Into Variance Reduction: source of the effective traffic multiplier framing, and honest that gains vary enormously by product.
- Xie & Aurisset, Improving the Sensitivity of Online Controlled Experiments: Case Studies at Netflix (KDD 2016).
Not covered: multi-covariate regression adjustment, variance reduction applied to ratio metrics, stratification as an alternative, bootstrap standard errors, and how to handle users with no pre-period at all beyond noting that an indicator variable is the usual answer.
Both simulations are checked against theory (the variance reduction against 1 − ρ², the delta-method standard error against a Monte Carlo of the same experiment) in the published comparison.
Part of a small suite of experimentation calculators. Every result comes with the caveat that would invalidate it, and every formula is checked against a reference implementation.
Built by Igor Lima. MIT License.