Tutorials › Statistical Theory I - Probability and Distribution Theory › Gradient Formulas for Scalar Functionals

Delta Method and Limit Operations · Tutorial 883 of 994

Gradient Formulas for Scalar Functionals

Learn to turn a multivariate asymptotic covariance matrix into the variance of a scalar functional by evaluating its gradient at the limiting parameter.

Advanced 11 min read

What You'll Learn

  • State the first-order delta-method variance for a scalar function of an asymptotically normal vector.
  • Compute gradients using a consistent column-vector convention.
  • Expand the variance into marginal-variance and covariance terms.
  • Work through linear contrasts, ratios, and smooth logarithmic functionals.
  • Identify when the first-order variance is zero and why that needs care.
  • Justify plug-in standard errors using consistency and Slutsky’s theorem.

From a Vector Limit to a Scalar Variance

Many estimators are naturally collected into a vector, but the quantity of scientific interest is often a single number: a contrast, a ratio, or another smooth function of the vector. The multivariate delta method turns the vector’s asymptotic covariance into an approximate variance for that scalar quantity. The key calculation is local: evaluate the gradient of the function at the limiting parameter, then use it to weight the covariance matrix.

This tutorial focuses on carrying out and interpreting that calculation. In particular, covariance terms matter: changing one coordinate of a function can be associated with changing another coordinate, so the off-diagonal entries of the covariance matrix cannot generally be ignored.

Definition: Let \(g:\mathbb{R}^p\to\mathbb{R}\) be differentiable at \(\theta=(\theta_1,\ldots,\theta_p)^\mathsf{T}\). Its gradient at \(\theta\) is the column vector $$ \nabla g(\theta)= \begin{pmatrix} \frac{\partial g}{\partial \theta_1}(\theta)\\ \vdots\\ \frac{\partial g}{\partial \theta_p}(\theta) \end{pmatrix}. $$ The gradient records the first-order change in the scalar function for small changes in each coordinate.

We use a column-vector gradient throughout. Thus the variance calculation is written as \(\nabla g(\theta)^\mathsf{T}\Sigma\nabla g(\theta)\), a scalar. The covariance matrix \(\Sigma\) is symmetric and nonnegative definite; it may be singular.

Theorem: Suppose \(r_n\to\infty\), \(r_n(T_n-\theta)\xrightarrow{d}N_p(0,\Sigma)\), and \(g\) is differentiable at \(\theta\), with \(T_n\) in the domain of \(g\) with probability tending to one. Then $$ r_n\{g(T_n)-g(\theta)\} \xrightarrow{d} N\!\left(0,\nabla g(\theta)^\mathsf{T}\Sigma\nabla g(\theta)\right). $$ If the displayed variance is zero, the normal distribution on the right is the point mass at zero. In the common case \(r_n=\sqrt n\), the first-order asymptotic variance of \(g(T_n)\) is \(\nabla g(\theta)^\mathsf{T}\Sigma\nabla g(\theta)/n\).

For a conventional differentiability condition, it is enough that the domain contain an open neighborhood of \(\theta\) and that \(g\) be differentiable there at \(\theta\). More generally, the proof only requires the first-order remainder condition at \(\theta\). A boundary point or a function that is not differentiable there requires separate care; the theorem does not simply apply by substituting a boundary value into a gradient formula.

Why the Gradient Produces the Variance

Differentiability says that for a small vector \(h\), the function changes by its linear approximation \(\nabla g(\theta)^\mathsf{T}h\), plus a remainder smaller than \(\|h\|\). Asymptotic normality makes \(T_n-\theta\) small at rate \(1/r_n\). After multiplying by \(r_n\), the remainder disappears, leaving a linear combination of the coordinates of the limiting normal vector.

1
Use differentiability.
Write \(g(\theta+h)-g(\theta)=\nabla g(\theta)^\mathsf{T}h+R(h)\), where \(R(h)=o(\|h\|)\) as \(h\to0\).
2
Scale the expansion.
Set \(h=T_n-\theta\). The scaled vector \(r_n(T_n-\theta)\) converges in distribution and is therefore bounded in probability.
3
Take the scalar limit.
The remainder vanishes in probability, and the linear term converges to a normal linear combination with variance \(\nabla g(\theta)^\mathsf{T}\Sigma\nabla g(\theta)\).

Here is the full justification of those steps. Write \(R(h)=\rho(h)\|h\|\), where \(\rho(h)\to0\) as \(h\to0\), taking \(R(0)=0\). Since \(r_n(T_n-\theta)\) converges in distribution, it is bounded in probability; consequently \(T_n-\theta\xrightarrow{p}0\). Continuity of \(\rho\) at zero gives \(\rho(T_n-\theta)\xrightarrow{p}0\), while \(r_n\|T_n-\theta\|=O_p(1)\). Hence $$ r_nR(T_n-\theta) =\rho(T_n-\theta)\,r_n\|T_n-\theta\| \xrightarrow{p}0. $$ The linear term is $$ \nabla g(\theta)^\mathsf{T}\{r_n(T_n-\theta)\} \xrightarrow{d} \nabla g(\theta)^\mathsf{T}Z, \qquad Z\sim N_p(0,\Sigma), $$ by the continuous mapping theorem. A linear combination of a multivariate normal vector is normal, with mean zero and variance \(\nabla g(\theta)^\mathsf{T}\Sigma\nabla g(\theta)\). Slutsky’s theorem then gives the stated limit. \(\square\)

Variance expansion: If \(a=\nabla g(\theta)\), then $$ a^\mathsf{T}\Sigma a =\sum_{i=1}^p a_i^2\Sigma_{ii} +2\sum_{1\leq i<j\leq p}a_i a_j\Sigma_{ij}. $$ In particular, the off-diagonal covariance terms contribute twice in the full quadratic form, once for each symmetric matrix entry.

To verify the expansion, multiply out the quadratic form: $$ a^\mathsf{T}\Sigma a =\sum_{i=1}^p\sum_{j=1}^p a_i\Sigma_{ij}a_j. $$ The diagonal terms are \(a_i^2\Sigma_{ii}\). For each pair \(i<j\), symmetry gives \(\Sigma_{ij}=\Sigma_{ji}\), so the two terms for that pair sum to \(2a_i a_j\Sigma_{ij}\). This proves the formula. \(\square\)

The diagonal entries of \(\Sigma\) are the coordinate variances in the limiting vector, and its off-diagonal entries are the coordinate covariances. A positive or negative covariance can increase or decrease the scalar variance depending on the signs of the corresponding gradient components.

Worked Gradient Calculations

Worked Example: A Contrast of Two Proportions

Suppose \(\hat p=(\hat p_1,\hat p_2)^\mathsf{T}\) estimates two category probabilities, and $$ \sqrt n\{\hat p-(0.20,0.30)^\mathsf{T}\} \xrightarrow{d}N_2\left(0, \begin{pmatrix} 0.16&-0.06\\ -0.06&0.21 \end{pmatrix}\right). $$ Find the first-order asymptotic variance for \(g(\hat p)=\hat p_1-\hat p_2\).

The function is \(g(x,y)=x-y\), so \(\nabla g(x,y)=(1,-1)^\mathsf{T}\) at every point. Substitution into the quadratic form gives $$ \begin{pmatrix}1&-1\end{pmatrix} \begin{pmatrix} 0.16&-0.06\\ -0.06&0.21 \end{pmatrix} \begin{pmatrix}1\\-1\end{pmatrix} =0.16+0.21-2(-0.06)=0.49. $$ Therefore \(\sqrt n\{(\hat p_1-\hat p_2)-(0.20-0.30)\}\xrightarrow{d}N(0,0.49)\), and the first-order variance of the contrast is \(0.49/n\). The negative covariance increases the variance of a difference: when the two gradient components have opposite signs, the covariance contribution is \(-2\Sigma_{12}\).

Worked Example: A Ratio With Correlated Components

Suppose \(\hat\theta=(\hat\theta_1,\hat\theta_2)^\mathsf{T}\) satisfies $$ \sqrt n\{\hat\theta-(2,4)^\mathsf{T}\} \xrightarrow{d}N_2\left(0, \begin{pmatrix} 0.25&0.10\\ 0.10&1 \end{pmatrix}\right). $$ Calculate the delta-method variance for \(g(\theta_1,\theta_2)=\theta_1/\theta_2\).

The function is differentiable where \(\theta_2\neq0\), and the limiting denominator is \(4\). Its gradient is $$ \nabla g(\theta_1,\theta_2)= \begin{pmatrix} 1/\theta_2\\ -\theta_1/\theta_2^2 \end{pmatrix}, \qquad \nabla g(2,4)= \begin{pmatrix}1/4\\-1/8\end{pmatrix}. $$ The covariance matrix is valid: its determinant is \(0.25(1)-(0.10)^2=0.24>0\), and its diagonal entries are positive. The variance calculation is $$ (1/4)^2(0.25)+(-1/8)^2(1) +2(1/4)(-1/8)(0.10) =\frac{1}{64}+\frac{1}{64}-\frac{1}{160} =\frac{1}{40}. $$ Thus \(\sqrt n\{\hat\theta_1/\hat\theta_2-1/2\}\xrightarrow{d}N(0,1/40)\), and the first-order variance of the ratio is \(1/(40n)\). The positive covariance reduces this variance because the two gradient components have opposite signs.

Worked Example: A Logarithmic Functional

Suppose \(\hat\theta=(\hat\theta_1,\hat\theta_2)^\mathsf{T}\) estimates positive parameters and $$ \sqrt n\{\hat\theta-(1,2)^\mathsf{T}\} \xrightarrow{d}N_2\left(0, \begin{pmatrix} 4&-0.5\\ -0.5&1 \end{pmatrix}\right). $$ Find the asymptotic variance for \(g(\theta_1,\theta_2)=\log(\theta_1)+2\log(\theta_2)\).

The function is defined on the positive quadrant, which contains \((1,2)\). Its gradient is $$ \nabla g(\theta_1,\theta_2)= \begin{pmatrix}1/\theta_1\\2/\theta_2\end{pmatrix}, \qquad \nabla g(1,2)= \begin{pmatrix}1\\1\end{pmatrix}. $$ The covariance matrix is nonnegative definite: its determinant is \(4(1)-(-0.5)^2=3.75>0\), with positive diagonal entries. Therefore, $$ \nabla g(1,2)^\mathsf{T}\Sigma\nabla g(1,2) =4+1+2(-0.5)=4. $$ Since \(g(1,2)=\log 4\), the result is \(\sqrt n\{g(\hat\theta)-\log 4\}\xrightarrow{d}N(0,4)\), giving first-order variance \(4/n\). Again, the negative covariance reduces the variance because both gradient entries are positive.

Plug-In Variances and Interpretation

In applications, \(\theta\) and often \(\Sigma\) are unknown. A standard estimated first-order variance replaces them with consistent estimates. Specifically, suppose \(\hat\theta\xrightarrow{p}\theta\), \(g\) has a continuous gradient near \(\theta\), and a covariance estimator \(\hat\Sigma\xrightarrow{p}\Sigma\). Then $$ \widehat V_n= \frac{1}{n}\nabla g(\hat\theta)^\mathsf{T}\hat\Sigma\nabla g(\hat\theta) \xrightarrow{p} \frac{1}{n}\nabla g(\theta)^\mathsf{T}\Sigma\nabla g(\theta) $$ in the sense that \(n\widehat V_n\xrightarrow{p}\nabla g(\theta)^\mathsf{T}\Sigma\nabla g(\theta)\). Indeed, continuity gives \(\nabla g(\hat\theta)\xrightarrow{p}\nabla g(\theta)\); the entries of the quadratic form are sums and products of quantities converging in probability, so the continuous mapping theorem gives the claimed convergence. Slutsky’s theorem then supports use of the estimated standard error when the limiting variance is positive.

The estimated covariance matrix must match the scaling convention. If \(\sqrt n(T_n-\theta)\) has limiting covariance \(\Sigma\), then the covariance of \(T_n\) is approximately \(\Sigma/n\). If a reported matrix already estimates the covariance of \(T_n\), dividing the resulting quadratic form by \(n\) again would be an error.

Common Mistakes

  • Dropping the covariance terms. Using only squared gradient components times marginal variances is correct only when the relevant covariances are zero. Use the full quadratic form, or the expanded formula including every off-diagonal contribution.
  • Using the gradient at the estimate in the theoretical limit. The limiting variance uses \(\nabla g(\theta)\). A gradient at \(\hat\theta\) is appropriate for a plug-in estimate, not for defining the population limit.
  • Confusing variance of the scaled limit with variance of the estimator. Under a \(\sqrt n\) limit, the quadratic form is the variance of the limiting distribution of the scaled error. The estimator’s first-order variance is that quantity divided by \(n\).
  • Assuming a zero gradient gives an ordinary nonzero normal approximation. If \(\nabla g(\theta)=0\), the first-order limit is degenerate at zero. This does not establish a useful nondegenerate approximation; a different order of analysis may be needed.
  • Using a derivative where the function is not defined or differentiable. A ratio requires a nonzero limiting denominator, and logarithms require positive arguments. Check the domain and the limiting point before applying the formula.
Key takeaway: For a scalar smooth functional of an asymptotically normal vector, the first-order variance is the gradient at the limiting parameter, on both sides of the covariance matrix: \(\nabla g(\theta)^\mathsf{T}\Sigma\nabla g(\theta)\). The off-diagonal covariance terms are part of the calculation, not optional corrections.

Check Your Understanding

For each question, identify the gradient and explain how the covariance matrix enters the answer.

  1. If \(g(x,y)=3x+y\), what gradient should be used, and what is its delta-method variance in terms of the entries of \(\Sigma\)?
  2. For \(g(x,y)=x/y\) at a point \((a,b)\) with \(b\neq0\), calculate both gradient components.
  3. In the contrast example, why did the negative covariance increase the variance?
  4. If the limiting covariance matrix is diagonal, which terms disappear from the expanded variance formula?
  5. What does a zero value of \(\nabla g(\theta)^\mathsf{T}\Sigma\nabla g(\theta)\) imply about the first-order limit, and what does it not establish?