16/25
Part 4 of 5 · The worked exampleLearn and do

Called once per arm, it keeps the raw difference but shrinks the interval

The tempting shortcut is one call per arm, and it fails quietly.

Control's four usersMean
x24685
from the pooled mean, 6-4-20+2-1
from control's own mean, 5-3-1+1+30

CUPED subtracts θ\theta times these distances. From the pooled center, control's distances average -1, so its mean rises by 0.75×10.75 \times 1, from 4.5 to 5.25. From its own center they average 0, and the mean stays at 4.5. Treatment mirrors it: 7.5 falls to 6.75 with the pooled center and stays at 7.5 with its own.

That's what one call per arm does. Each call centers its arm at that arm's own mean of xx, so the adjustment sums to zero inside each arm. Each arm's adjusted mean equals its raw mean, and the difference doesn't move at all: 3.0 on the eight users.

The variances still shrink, though, and the standard error with them. So you report the raw estimate with a CUPED-sized interval. In 10,000 simulated A/A tests at ρ=0.7\rho = 0.7, where both arms got the same experience, that called 15.9% of them significant at a nominal 5%.

In the editor, adjust and best_theta are ready. Write cuped_readout(y, x, t): the difference and the lift from one call on all users.