Reduce Experiment Variance Using Pre-Period Behavior With CUPED

Last updated: November 29, 2026

Quick Overview

Derive the CUPED adjustment for an A/B test metric using each user's pre-experiment value of the same metric, show why it reduces variance without biasing the treatment effect, and implement it.

Mixpanel
Statistics & Math
Data Scientist
Mixpanel
November 29, 2026
Data Scientist
Onsite
Statistics & Math
Hard

0

0

0 solved


Derive the CUPED adjustment for an A/B test metric using each user's pre-experiment value of the same metric, show why it reduces variance without biasing the treatment effect, and implement it.

Experiments on product analytics data are often underpowered for smaller customers, and an analytics vendor like Mixpanel already holds each user's pre-experiment event history, which makes covariate adjustment cheap. The interviewer checks derivation, the conditions for unbiasedness, and practical handling of new users.

What the Interviewer Expects
  • Write the adjusted metric and derive the optimal theta
  • Show variance reduction equals the squared correlation
  • Explain unbiasedness: covariate is unaffected by treatment because it is pre-period
  • Pool theta across arms rather than fitting per arm
  • Handle users without pre-period data
  • Implement and sanity check the adjustment
Key Topics to Cover
CUPED
variance reduction
covariates
regression adjustment
statistical power
How to Approach This
  1. Define your hypotheses (H0 and H1) clearly before performing any test.
  2. Calculate required sample size BEFORE running an experiment, using power analysis.
  3. Remember the Central Limit Theorem: sample means become approximately normal with large n.
  4. Watch for Simpson's paradox. Always segment data by key dimensions.
  5. Distinguish between statistical significance and practical significance.
Possible Follow-up Questions
  • How does CUPED relate to regression adjustment with a treatment indicator?
  • What happens if you accidentally use a covariate measured after the experiment started?
  • How would you apply this to a ratio metric like conversion per session?
  • How much sample size does a correlation of 0.7 save?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Browse Statistics Questions
Sample Answer
Clarify

Metric YY (for example events per user during the test), covariate XX (the same metric in the two weeks before assignment). Randomization is at the user level. We want a lower-variance estimator of ...

Approach

Define Ycv=Y−θ(X−E[X])Y^{cv} = Y - \theta (X - E[X]). Since E[X]E[X] is the same in both arms (randomization, and XX is measured before treatment), E[YTcv]−E[YCcv]=ΔE[Y^{cv}_T] - E[Y^{cv}_C] = \Delta, so the estimator stays unbia...


Submit Your Answer
Markdown supported

Related Questions