What is the delta method?

The delta method approximates the variance of a function of random quantities by linearizing it around their means. In A/B testing it is especially helpful for analyzing lift instead of the raw difference, and for ratio metrics, where both the numerator and the denominator vary.

Also called
delta method variance, taylor expansion variance, ratio variance estimator
Allon Korem

Written by Allon Korem

Chief Executive Officer

Last updated

Design experiments inside Claude with Bell's MCP serverIt runs the Bell Statistics engine as tools your assistant can call — geo test design and measurement today, A/B testing next.

Get the MCP server

In plain English

Estimating the variance of a KPI is straightforward — until it isn't. For a simple KPI with a per-user value, we can estimate its variability directly from the distribution of those user-level values. But when a KPI is itself a function of other quantities, its variance needs to be estimated differently.

When does this come up in A/B testing? One common example is lift. Rather than looking at the raw difference between the treatment and control means, lift expresses that difference relative to the baseline (control) mean. In other words, it is a ratio involving two estimated quantities, rather than a single mean.

Another common example is ratio KPIs, where one quantity is divided by another — for example, clicks per session, revenue per order, items per basket, or cost per acquisition. In these cases, there is no single per-user value whose standard deviation directly captures the variability of the KPI. Instead, both the numerator and denominator are estimated from the data, so variation in either one affects how much the final ratio can vary.

This is where the delta method comes in. In simple terms, the delta method provides a way to estimate how variation in the underlying quantities translates into variation in the final KPI. It does this by using a Taylor expansion to approximate the original, potentially complicated function with a simpler linear function around the values estimated from the data. Because the approximated function is linear, its variance can be calculated using the variances and covariances of the underlying quantities. This gives us an approximation of the variance of the original KPI.

For a deeper understanding of the formulas and how the delta method is derived, see the following section.

The formula

The delta method is based on the Taylor expansion, which lets us approximate a complicated function with a simpler one around the values estimated from the data. The delta method keeps only the first-order term, giving us a linear approximation. Because we can calculate the variance of a linear function from the variances and covariances of its inputs, this gives us an approximation of the variance of the original KPI.

0.5μ = 11.50121st orderthe delta method2nd order3rd order6th orderg(x) = 1/xTaylorapproximationaround μ
The Taylor expansion of g(x) = 1/x around its mean μ. Each added derivative bends the approximation closer to the true curve; the delta method keeps only the first, straight-line step, which is accurate near the mean — where, with experiment sample sizes, the estimates are.
The general form
Var( g(X) ) ≈ ∇g(μ)ᵀ Σ ∇g(μ)

The delta method approximates the variance of a function of one or more random quantities by looking at how sensitive the function is to changes in those quantities. If the KPI is a function g(X) of a vector of random quantities X, its variance depends on two things: how sensitive the KPI is to each input, and how much those inputs vary and covary.

  • ∇g(μ) is the vector of derivatives of g, evaluated at the mean.
  • Σ is the variance-covariance matrix of the random quantities.
With two inputs
Var( g(X, Y) ) ≈ [∂g/∂x]² Var(X) + [∂g/∂y]² Var(Y) + 2(∂g/∂x)(∂g/∂y) Cov(X, Y)

The first two terms capture the contribution of the variability in X and Y, while the final term accounts for their covariance — the extent to which X and Y vary together. Intuitively, the formula combines how much the KPI responds to changes in each input with how much each input varies, while also accounting for whether the inputs tend to move together. The two most common uses in A/B testing are ratio KPIs and lift.

  • ∂g/∂x is how sensitive the KPI is to changes in X.
  • ∂g/∂y is how sensitive the KPI is to changes in Y.
1. Ratio KPIs
g(X, Y) = XY
∂g/∂X = 1Y, ∂g/∂Y = −XY²
Var(X/Y) ≈ 1μY²Var(X) + μX²μY⁴Var(Y) − 2μXμY³Cov(X, Y)

Consider a ratio KPI such as revenue per order. Because it depends on two random quantities, we use the multivariate version of the delta method and take the derivative with respect to each input; the derivatives tell us how sensitive the ratio is to changes in the numerator and the denominator. The result has three components: the variability of the numerator, the variability of the denominator, and the covariance between them — how much the two quantities tend to move together. The covariance term is important because the numerator and denominator are often related.

  • X is the numerator, here revenue.
  • Y is the denominator, here the number of orders.
  • μX and μY are their means.
00.0040.0080.01200.20.40.60.8Correlation between a user's clicks and sessionsStandard errorr = 0.83: full delta method SE = 0.0094this example: 0.0094Covariance omitted0.0121, too wideFull delta methodSessions treatedas independent0.0043, too narrow
Why the covariance term matters, using the worked example below: the standard error of clicks per session as the correlation between a user's clicks and sessions varies, with everything else held fixed. With no correlation, leaving out the covariance term costs nothing; the stronger the correlation, the more it overstates the uncertainty. Treating sessions as independent is wrong at every level, because only users were randomized: one user's sessions are correlated with each other, so counting 214,000 sessions as separate observations claims about four times more information than the 52,000 users provide, and the standard error comes out too small.
2. Lift
Lift = T − CC, g(T, C) = TC − 1
∂g/∂T = 1C, ∂g/∂C = −TC²
Var(Lift) ≈ 1μC²Var(T) + μT²μC⁴Var(C)

The −1 does not affect the variance, so we can focus on T/C. There would normally also be a covariance term, but in an A/B test the treatment and control groups are independently randomized, so their covariance is zero. This is the key idea behind both examples: start with the KPI as a function, use its derivatives to obtain a linear approximation, and then use the variability of the inputs to estimate the variability of the KPI.

  • T is the treatment mean.
  • C is the control mean.
  • μT and μC are their expected values.
Remark: the unit of analysis matters

The variances and covariances used in these calculations should be computed across the randomization units. If users were randomized, for example, the calculation should be based on user-level observations, not individual sessions. Treating multiple sessions from the same user as independent observations overstates the amount of information in the data and can produce confidence intervals that are too narrow.

Optional check: the bootstrap

The delta-method calculation can be checked against a cluster bootstrap, which repeatedly resamples whole randomization units and recalculates the KPI. The resulting distribution provides an alternative estimate of the KPI's variability. When the delta-method approximation is appropriate and correctly implemented, the two approaches should generally agree closely, and a substantial disagreement is a useful signal that something in the calculation or implementation needs to be checked. The bootstrap is, however, much more computationally intensive, as the KPI needs to be recalculated many times across the resampled datasets. For this reason, the delta method is generally preferable when its assumptions are appropriate, while the bootstrap serves as a useful validation, or an alternative when those assumptions are questionable.

Worked example

An analytics team implements a standard error for clicks per session. They have 52,000 randomized users generating 214,000 sessions and 396,000 clicks. At the user level, let C denote a user's clicks and S their sessions, so the KPI is the ratio g(C, S) = C/S. The user-level data look like this:

Users, n
52,000
Total clicks
396,000
Total sessions
214,000
Var(C)
121.11
Var(S)
2.287
Cov(C, S)
13.814
Corr(C, S)
0.83
  1. 1. The KPI: clicks per session

    C/S = 396,000214,000 = 1.851
  2. 2. The per-user means

    C̄ = 396,00052,000 = 7.615, S̄ = 214,00052,000 = 4.115
  3. 3. The delta method, per user

    Var(C)S̄² + C̄² Var(S)S̄⁴ − 2C̄ Cov(C, S)S̄³
  4. 4. Substituting the values

    121.114.115² + 7.615² × 2.2874.115⁴ − 2 × 7.615 × 13.8144.115³
  5. 5. The three terms: numerator, denominator, covariance

    7.152 + 0.463 − 3.020 = 4.59
  6. 6. The standard error, dividing by the number of users

    SE = √[4.5952,000] = 0.0094

SE = 0.0094 clicks per session

The covariance term is important: because clicks and sessions are strongly positively correlated (r = 0.83), users with more sessions also tend to have more clicks. This shared variability partially cancels when forming the ratio, which is why the covariance term is subtracted. For comparison, three implementations give three answers: 0.0043 when sessions are treated as independent, 0.0121 for a user-level calculation with the covariance omitted, and 0.0094 for the full delta method — a spread of a factor of 2.8. Treating sessions as independent gives too small an answer because it treats 214,000 correlated sessions as independent, while the user-level calculation without covariance is too large because it ignores the cancellation produced by the strong correlation between clicks and sessions. The full delta method gives the correct result, and a cluster bootstrap independently returns 0.0093, providing a useful validation of the implementation.

Common misconceptions

“The delta method is an exotic technique for unusual metrics.”
It is the standard way any mature experimentation platform computes standard errors for ratio metrics, which are among the most common metrics there are — clicks per session, revenue per order, items per basket. If a platform reports intervals on those at all, it is either using this or a bootstrap.
“The covariance term is a refinement that can be skipped.”
It is usually the largest correction of the three. Numerator and denominator are strongly correlated in almost every real ratio metric, so omitting it substantially overstates the variance. The result is an interval that is too wide, which is safer than too narrow but still wrong, and it costs real power on every experiment.
“Because it is an approximation, the delta method is less trustworthy than exact methods.”
The approximation is a first-order Taylor expansion, and its error shrinks as the sample grows. At experiment sample sizes it agrees with a bootstrap to within a percent or two. The far bigger source of error in practice is aggregating at the wrong unit, which is an implementation mistake rather than a limitation of the method.

Frequently asked questions

Which metrics need the delta method?
Any metric that divides one random total by another — clicks per session, revenue per order, cost per acquisition, items per basket. The distinguishing feature is that no single user contributes one value to the metric; the metric is computed from two sums. Ordinary averages where each user contributes one number, such as revenue per user, do not need it for the metric itself — but relative lift, (T − C)/C, divides by an estimated control mean, so its interval needs the delta method too.
Should I implement the delta method or just bootstrap?
The delta method for production, because it is a closed-form expression that costs almost nothing per experiment, and a bootstrap once to verify the implementation. That pairing catches the two errors that matter — a missing covariance term and aggregating at the wrong unit — both of which produce plausible numbers that no amount of code review reliably spots.
What level should the variances be computed at?
The randomization unit, always. If users were randomized, every variance and covariance in the formula is computed across users, even when the metric counts sessions or events. Computing them at event level treats correlated observations as independent and shrinks the interval by roughly the square root of the events per user, which is commonly a factor of two or more.

Related terms

  • Bootstrap

    Resample your own data ten thousand times and watch the answer wobble — uncertainty for statistics with no formula.

  • Metric sensitivity

    Whether the number can move at all in the time you have — the property that decides which metrics are usable.

  • Ratio metric

    When the denominator is random too, the ordinary standard error is wrong — and the interval it produces is too narrow.

  • Regression adjustment

    Control for what you knew before the test started — the general case that CUPED is one instance of.

Calculate it

  • Proportion confidence interval

    A defensible interval around one rate — Wilson, Agresti-Coull, Jeffreys and Clopper-Pearson, side by side.

  • Two-sample t-test

    Compare the average of two independent groups — plan the sample size, then test the result.

Knowing the term is the easy part

Applying it to a live measurement problem is the part that goes wrong. If you are designing an experiment, reading a result you do not trust, or trying to work out what your marketing actually caused, that is the work we do.

Design experiments inside Claude with Bell's MCP server

Get the MCP server