CUPED (Controlled-experiment Using Pre-Experiment Data)

  • Updated
 

The CUPED (Controlled-experiment Using Pre-Experiment Data) functionality is a statistical method that reduces variance in A/B tests, enhancing their sensitivity and making it easier to detect differences between groups. By lowering variance, CUPED lets experiments achieve statistical significance with less data if there is a true treatment effect. Introducing CUPED as an option for Optimizely A/B/n tests addresses challenges like insufficient traffic and high variance, making experiments more efficient.

Here are some important considerations when using this feature. CUPED can help reduce variance, which may enhance the significance of experiment results in certain cases.

    • Metric Compatibility – This feature is available only for numeric metrics (not conversion metrics) as it is most effective for these data types.
    • Covariate Limitation – Covariates refer to pre-experiment data used for adjustments. Only pre-experiment calculations of the primary and secondary target metrics are used as covariates. User-defined customization of features is not yet supported.
    • Supported Platforms – This feature works on Snowflake, BigQuery, and Databricks. Contact Optimizely with requests for additional warehouse support.
    • Health Checks – No health checks are available yet for unexpected feature imbalances (similar to sample ratio mismatch (SRM) checks). Unbalanced features, especially with sparse prior data, may increase variance, but this is an empirical issue that may not occur.
    • Data Requirement – Prior data spans from two weeks before the experiment's start date to the user's first decision event. If no prior data exists (such as for a new metric), CUPED has no effect.

Enable CUPED

  1. Create an Experiment Scorecard in Analytics.
  2. Choose the preferred Experiment using the selector and enable the CUPED toggle. 

cuped-toggle.png

The Add cuped duration option changes the period of data that CUPED uses. CUPED uses two weeks of historical data by default, but you can change it to a custom period.

add-cuped-duration.png

In the Analytics Experiment Scorecard template, using CUPED impacts the variance reduction and sensitivity of your experiment metrics. The following are the results of the Dragon Recommendations scorecard built with and without CUPED.

With CUPED

Without CUPED

Statistical methodology

Optimizely CUPED model is a regression-based covariance adjustment method, which is more advanced than the standard CUPED method. It uses a linear regression model to filter out noise by utilizing pre-experiment data:

Screenshot 2025-04-17 at 6.32.33 PM.png

where 

  • Yi denotes the value of a target metric (numeric metric) for person i
  • Ti denotes the treatment indicator
  • Screenshot 2025-04-17 at 6.40.06 PM.png denotes the centered covariates derived from the pre-experiment data
  • α, β, and Screenshot 2025-04-17 at 6.46.38 PM.png denote regression coefficients
  • ei is the error term

The Ordinary Least Squares (OLS) estimator Screenshot 2025-04-17 at 6.48.17 PM.png is an unbiased estimator for the true treatment effect.

Having pre-experiment data Screenshot 2025-04-17 at 6.40.06 PM.png in the model reduces the variance of Screenshot 2025-04-17 at 6.48.17 PM.png(that is, variance reduction), resulting in a higher chance of seeing a significant result.

Notice that if Screenshot 2025-04-17 at 6.40.06 PM.pngcontains nothing but the historical value of Yi, then the CUPED method(Equation 1) is reduced to the standard CUPED method; thus, our CUPED method is more general and is preferred over the standard CUPED method.

In practice, our CUPED method works in two steps (following the Frisch-Waugh-Lovell theorem): 

  1. Regress Yi on Screenshot 2025-04-17 at 6.40.06 PM.png and compute the predicted values Screenshot 2025-04-17 at 6.52.14 PM.png
  2. Compute the residuals YiScreenshot 2025-04-17 at 6.52.14 PM.png and feed the residuals into our Stats Engine.