All problems
CUPED Adjusted Estimate
Problem
CUPED adjusts a treatment effect estimate using a pre-experiment covariate: y_adjusted = mean(y) - theta * (mean(x) - mean(x_prior)).
Given the post-experiment mean, the covariate mean, the pre-period covariate mean, and theta, return the adjusted estimate.
Hint
Shift the mean by the scaled covariate imbalance.
Test cases
case 1
in: [1,5,4,0.5]
expected: 0.5
case 2
in: [10,10,10,1]
expected: 10
case 3
in: [3,8,6,1.5]
expected: 0
Starter codePython
def cuped_adjusted_estimate(mean_y, mean_x, mean_x_prior, theta):
# Your code here
pass3 test cases · run your code against them in the editor