Why Constraints Change the Estimate
In a multivariate Gaussian model, an unrestricted estimate of the mean is the sample mean. But scientific knowledge may require its components to satisfy exact linear relationships: two population means may be equal, a weighted sum may be fixed, or several means may obey conservation equations. The estimate must then stay within the set of means allowed by those restrictions.
The best constrained value is not generally the closest allowed vector in ordinary Euclidean distance. The likelihood measures discrepancies using the covariance matrix, so the appropriate projection depends on the scale and correlation of the measurements. This tutorial derives that covariance-weighted projection for a known covariance matrix.
From the Likelihood to a Constrained Distance
Write \(\bar X=n^{-1}\sum_{i=1}^n X_i\) for the sample mean, and let \(\bar x\) denote its observed value. With \(\Sigma\) fixed, the part of the log-likelihood that depends on \(\mu\) is
where \(C\) and \(C'\) do not depend on \(\mu\). The second expression follows by writing \(x_i-\mu=(x_i-\bar x)+(\bar x-\mu)\): the cross terms sum to zero because \(\sum_i(x_i-\bar x)=0\). Thus maximizing the likelihood over \(A\mu=b\) is equivalent to minimizing the squared distance from \(\bar x\) to \(\mu\), measured by \(\Sigma^{-1}\):
Since \(\Sigma^{-1}\) is positive definite, this objective is strictly convex in \(\mu\). The constraint set is an affine subspace, so a minimizer, if found, is unique. The following result gives it explicitly.
To see why the inverse exists, take any nonzero \(v\in\mathbb{R}^r\). Full row rank of \(A\) implies \(A^{\mathsf T}v\neq 0\), and positive definiteness of \(\Sigma\) gives
Therefore \(A\Sigma A^{\mathsf T}\) is positive definite and invertible.
Deriving and Verifying the Estimate
Introduce a Lagrange multiplier \(\lambda\in\mathbb{R}^r\) for the constraint. It is convenient to minimize one half of the quadratic objective; this does not change its minimizer. The Lagrangian is
Differentiating with respect to \(\mu\) and setting the gradient equal to zero gives
Substitute this expression into \(A\mu=b\). Solving the resulting \(r\)-dimensional system determines \(\lambda\), and hence \(\mu\):
This candidate satisfies the constraint, since
It is the unique minimizer because the objective has positive-definite Hessian \(\Sigma^{-1}\). More explicitly, for any nonzero \(h\in\mathbb{R}^p\), \(h^{\mathsf T}\Sigma^{-1}h>0\); thus the objective is strictly convex, and its stationary point on the feasible affine set is the unique constrained minimum. This proves the theorem. \(\square\)
Worked Example: One Restriction With Correlated Components
Suppose \(X_i\sim N_2(\mu,\Sigma)\), where \(\Sigma=\begin{pmatrix}4&1\\1&2\end{pmatrix}\) is known, and the observed sample mean is \(\bar x=(3,1)^{\mathsf T}\). Impose the restriction \(\mu_1+\mu_2=2\). Find the constrained estimate.
Here \(A=(1,1)\) and \(b=2\). First calculate the two quantities in the correction:
The formula therefore gives
The estimate obeys the restriction: \(7/4+1/4=2\). The two components are adjusted by different amounts because the covariance-weighted geometry is not ordinary Euclidean geometry.
Worked Example: A Diagonal Covariance and a Weighted Equality
Let \(\Sigma=\operatorname{diag}(1,9)\), let \(\bar x=(4,1)^{\mathsf T}\), and require \(\mu_1-2\mu_2=0\). Thus \(A=(1,-2)\), \(b=0\), and the restriction is \(\mu_1=2\mu_2\).
Compute the discrepancy and the covariance terms:
Hence
The first component is twice the second, since \(146/37=2(73/37)\). The adjustment is \((-2/37,36/37)^{\mathsf T}\). In particular, the component with larger variance moves more in this example; the restriction is met at the likelihood-optimal cost, not by minimizing the unweighted size of the adjustment.
Projection Geometry and the Cost of the Restriction
The estimate is a projection in the inner product defined by \(\Sigma^{-1}\): the squared length of a vector \(u\) is \(u^{\mathsf T}\Sigma^{-1}u\). This choice of metric follows directly from the Gaussian likelihood. A useful way to confirm the projection interpretation is to compare the constrained estimate with any other feasible value.
To prove the result, both \(\mu\) and \(\hat\mu_c\) satisfy the restriction, so \(Ad=0\). The formula for the estimate also gives
Expanding \(\bar x-\mu=(\bar x-\hat\mu_c)-d\), the difference between the two sides' quadratic terms is the extra term \(d^{\mathsf T}\Sigma^{-1}d\) plus a cross term. That cross term vanishes:
The displayed identity follows. Since \(\Sigma^{-1}\) is positive definite, \(d^{\mathsf T}\Sigma^{-1}d\geq 0\), and it is zero only when \(d=0\). This proves both minimality and uniqueness. \(\square\)
The same identity quantifies the increase in the minimized quadratic distance. The unrestricted estimate is \(\bar x\), so the constrained estimate pays the distance
The expression is nonnegative and is zero exactly when the sample mean already satisfies the restriction. Because the log-likelihood contains \(-n/2\) times the quadratic distance, the corresponding loss in maximized log-likelihood relative to the unrestricted fit is \(n/2\) times this quantity.
Worked Example: Two Restrictions in Three Dimensions
Let \(\Sigma=\operatorname{diag}(1,2,1)\), \(\bar x=(2,0,1)^{\mathsf T}\), and impose \(\mu_1+\mu_3=0\) and \(\mu_2+\mu_3=0\). Use \(A=\begin{pmatrix}1&0&1\\0&1&1\end{pmatrix}\) and \(b=(0,0)^{\mathsf T}\).
The discrepancy is \(A\bar x-b=(3,1)^{\mathsf T}\). Direct multiplication gives
Multiplying the last two matrices gives the adjustment \((8/5,-2/5,7/5)^{\mathsf T}\). Therefore
Both restrictions hold: \(2/5-2/5=0\) and \(2/5-2/5=0\). This example also shows that the constraints can be handled together using the \(r\times r\) matrix \(A\Sigma A^{\mathsf T}\), even when the mean vector has more components.
Common Pitfall and Interpretation
A common mistake is to use the ordinary Euclidean projection of \(\bar x\) onto \(A\mu=b\), effectively replacing \(\Sigma\) by the identity matrix. That works only when the covariance metric is proportional to the Euclidean metric, or in special cases where both projections happen to coincide. In general, ignoring \(\Sigma\) ignores how the Gaussian likelihood scales discrepancies and accounts for correlations.
Another error is to apply the restriction to the observed sample mean and then adjust components by intuition. The formula shows that the adjustment has a specific direction, \(\Sigma A^{\mathsf T}\), and a size determined by \(A\Sigma A^{\mathsf T}\). It both enforces the restriction and minimizes the likelihood-based distance. The assumptions matter: this result treats \(\Sigma\) as known and positive definite. If the covariance is also unknown, the likelihood optimization changes; this formula should not be used without checking the model.
Check Your Understanding
Use the model assumptions stated above to answer these questions.
- Why must \(A\Sigma A^{\mathsf T}\) be invertible under the stated rank and covariance conditions?
- For a single restriction \(a^{\mathsf T}\mu=b\), identify the direction in which the sample mean is adjusted.
- When is the constrained estimate equal to the unrestricted sample mean?
- Explain why a Euclidean projection need not maximize the Gaussian likelihood when \(\Sigma\) is not proportional to the identity matrix.
- What is the increase in the minimized quadratic distance caused by imposing the restriction?