Why Constrained Covariance Likelihood Requires Care
A covariance model can be statistically appealing but mathematically infeasible: its fitted matrix may fail to be positive definite, or an unconstrained optimizer may violate restrictions such as nonnegative variance components. Maximum likelihood for structured covariance therefore has two linked tasks: optimize the likelihood and ensure every candidate covariance belongs to the specified model and is a valid covariance matrix.
The central calculation is a covariance score: the derivative of the Gaussian log-likelihood in a permitted covariance direction. It shows which structural parameters can be adjusted to improve fit, and it distinguishes an interior solution, where the score vanishes, from a boundary solution, where an active constraint can prevent further improvement.
Likelihood and Feasible Covariances
Suppose \(X_1,\ldots,X_n\) are independent \(p\)-dimensional observations from \(N_p(\mu,\Sigma(\theta))\). Treat the mean \(\mu\) as fixed while differentiating with respect to the covariance parameters \(\theta\). Define the residual second-moment matrix \(S=n^{-1}\sum_{i=1}^n (X_i-\mu)(X_i-\mu)'\). Up to a constant not depending on \(\theta\), the log-likelihood is
This expression applies when \(\Sigma(\theta)\) is positive definite. If the mean is also an unknown parameter, the joint likelihood uses residuals from the fitted mean; covariance derivatives are still taken holding the mean fixed. At a joint maximum, the covariance score equations are evaluated at the jointly fitted parameters.
For example, a linear covariance-component model has \(\Sigma(\theta)=\sum_{j=1}^q \theta_j A_j\), with known symmetric component matrices \(A_j\). The coefficients may also be required to satisfy inequalities, such as \(\theta_j\geq0\) for variance components. These inequalities alone do not always ensure positive definiteness, so both kinds of restrictions must be checked.
Deriving the Covariance Score
The following result gives the score for any differentiable covariance parameterization. It is useful whether the model is linear in its parameters or is defined through a nonlinear map.
Proof. For a differentiable positive-definite matrix, the differential identities are \(d\log|\Sigma|=\operatorname{tr}(\Sigma^{-1}d\Sigma)\) and \(d\Sigma^{-1}=-\Sigma^{-1}(d\Sigma)\Sigma^{-1}\). The first follows by differentiating the determinant, and the second follows by differentiating \(\Sigma\Sigma^{-1}=I\). Applying them to the log-likelihood gives
In the last equality, cyclic invariance of the trace puts \(d\Sigma\) at the end of the product. Setting \(d\Sigma=\Sigma_j\,d\theta_j\) and dividing by \(d\theta_j\) proves the formula. \(\square\)
For a linear covariance-component model, \(\Sigma_j=A_j\), so the score for component \(j\) is the trace in the theorem with \(A_j\) in place of \(\Sigma_j\). At a feasible interior maximum, all such scores must be zero. This condition is necessary, not sufficient: it does not by itself establish that the point is a maximum or that it is globally optimal.
Worked Example: The MLE in a Diagonal Covariance Model
Let three independent observations be \(x_1=(1,0)'\), \(x_2=(-1,2)'\), and \(x_3=(0,-2)'\), each from \(N_2(0,\Sigma)\), with the mean fixed at zero and \(\Sigma=\operatorname{diag}(v_1,v_2)\), \(v_1,v_2>0\). The residual second-moment matrix is
The diagonal model uses only the diagonal entries in the trace term, so, apart from constants, \(\ell=-\frac{3}{2}\{\log v_1+\log v_2+(2/3)/v_1+(8/3)/v_2\}\). For either variance \(v\), a term of the form \(-\frac{3}{2}(\log v+c/v)\) has derivative \(-\frac{3}{2}(1/v-c/v^2)\), which vanishes at \(v=c\). Its second derivative there is \(-3/(2c^2)<0\), and the likelihood tends downward at either end of the positive range. Thus the maximum is \( \hat v_1=2/3,\ \hat v_2=8/3\). The nonzero off-diagonal entry of \(S\) does not alter this result: the diagonal covariance model cannot fit a nonzero covariance.
Boundary Constraints and Inequality Restrictions
When a parameter is constrained, an optimum need not have zero score in every coordinate. For maximizing \(\ell(\theta)\) subject to smooth inequalities \(g_k(\theta)\geq0\), define \(q(\theta)=-\ell(\theta)\) and minimize \(q\). At a regular local solution, the Karush–Kuhn–Tucker necessary conditions require multipliers \(\lambda_k\geq0\) for active inequalities such that
These are necessary conditions when the objective and constraints are differentiable and an appropriate constraint qualification holds (for example, the linear independence constraint qualification). They say that an active constraint can balance a nonzero likelihood score. Positive definiteness is normally enforced by restricting the parameterization to positive-definite matrices; if an optimum is sought on a boundary where the covariance becomes singular, the ordinary nondegenerate Gaussian likelihood no longer applies.
Worked Example: A Variance Component at Its Boundary
Take \(n=2\) observations \(x_1=(1,-1)'\) and \(x_2=(-1,1)'\) from \(N_2(0,\Sigma)\), with \(\Sigma=aI_2+b\mathbf{1}\mathbf{1}'\), \(a>0\), \(b\geq0\), and \(\mathbf{1}=(1,1)'\). The observed second moment is \(S=\frac12\sum_i x_ix_i'=\begin{pmatrix}1&-1\\-1&1\end{pmatrix}\). The covariance eigenvalues are \(a\) in the contrast direction \((1,-1)'\) and \(a+2b\) in the common direction \((1,1)'\). The eigenvalues of \(S\) in those same directions are \(2\) and \(0\), respectively.
Consequently, the part of the negative log-likelihood depending on \(a,b\), after dropping the positive factor \(n/2\), is \(\log a+\log(a+2b)+2/a\). For each fixed \(a>0\), \(\log(a+2b)\) increases with \(b\), since its derivative is \(2/(a+2b)>0\). The likelihood is therefore maximized over \(b\geq0\) at \(b=0\). With \(b=0\), minimize \(2\log a+2/a\). Its derivative is \(2/a-2/a^2=2(a-1)/a^2\), which is negative below 1 and positive above 1. Hence the global minimum is at \(a=1\), and the constrained MLE is \((\hat a,\hat b)=(1,0)\).
At this solution, \(\Sigma=I_2\). The score for \(b\), using \(\Sigma_b=\mathbf{1}\mathbf{1}'\), is \(\frac{n}{2}\operatorname{tr}[(S-I_2)\mathbf{1}\mathbf{1}']=-2\). Increasing \(b\) would lower the likelihood, so a zero score is not required for this active boundary parameter.
Direct and Factor-Based Parameterizations
A direct parameterization works with covariance entries or structural coefficients and imposes positive definiteness as a constraint. It makes the structural meaning of parameters explicit and often gives simple score directions. Its weakness is that positive definiteness can be awkward to maintain during numerical optimization.
A factor-based parameterization writes \(\Sigma=LL'\), where \(L\) is nonsingular, often lower triangular with positive diagonal entries. This guarantees positive definiteness: for every nonzero vector \(u\), \(u'\Sigma u=(L'u)'(L'u)>0\). However, a generic factor \(L\) does not automatically preserve a desired covariance structure. The factor must be restricted or constructed so that its product \(LL'\) lies in the target family.
The score transforms by the chain rule. Let \(G=\frac{n}{2}(\Sigma^{-1}S\Sigma^{-1}-\Sigma^{-1})\), the symmetric matrix in the covariance differential. For a differentiable factor \(L(\phi)\),
Thus each factor-coordinate score is obtained by substituting \(dL=(\partial L/\partial\phi_j)d\phi_j\). If all entries of \(L\) were free, the matrix gradient would be \(2GL\); for a lower-triangular factor, only the allowed entries contribute. This chain rule gives a score in feasible coordinates without treating the covariance entries as independent.
Worked Example: A Two-Variable Factor Parameterization and Its Score
Consider the equal-variance covariance family \(\Sigma=s\begin{pmatrix}1&\rho\\\rho&1\end{pmatrix}\), with \(s>0\) and \(-1<\rho<1\). Its factor \(L=\begin{pmatrix}\sqrt{s}&0\\ \rho\sqrt{s}&\sqrt{s(1-\rho^2)}\end{pmatrix}\) satisfies \(LL'=\Sigma\) and has positive diagonal entries. At \(s=4,\rho=1/2\), \(L=\begin{pmatrix}2&0\\1&\sqrt3\end{pmatrix}\) and \(\Sigma=\begin{pmatrix}4&2\\2&4\end{pmatrix}\), whose determinant is \(12>0\).
For four observations with known zero mean, take the data to be \(u,-u,v,-v\), where \(u=(\sqrt{10},\sqrt{2/5})'\) and \(v=(0,\sqrt{8/5})'\). Their second moment is \(S=\frac12(uu'+vv')=\begin{pmatrix}5&1\\1&1\end{pmatrix}\). At the parameter values above, \(\Sigma^{-1}=\begin{pmatrix}1/3&-1/6\\-1/6&1/3\end{pmatrix}\), and direct multiplication gives \(\Sigma^{-1}S\Sigma^{-1}=\begin{pmatrix}17/36&-7/36\\-7/36&5/36\end{pmatrix}\). Since \(n/2=2\), the covariance gradient matrix is \(G=\begin{pmatrix}5/18&-1/18\\-1/18&-7/18\end{pmatrix}\).
The direct-coordinate derivatives are \(\Sigma_s=\begin{pmatrix}1&1/2\\1/2&1\end{pmatrix}\) and \(\Sigma_\rho=\begin{pmatrix}0&4\\4&0\end{pmatrix}\). Therefore \(\partial\ell/\partial s=\operatorname{tr}(G\Sigma_s)=-1/6\) and \(\partial\ell/\partial\rho=\operatorname{tr}(G\Sigma_\rho)=-4/9\). These are scores at the stated parameter point, not claims that it is an optimum. The factor coordinates keep every permitted point positive definite, while the direct coordinates make the two structural directions and their scores transparent.
Common Pitfall and Practical Checks
A common mistake is to solve the unconstrained score equations and accept the resulting matrix without checking the model restrictions. A stationary point can have a negative variance component, violate a structural equality, or produce a covariance matrix that is not positive definite. The correction is to define the feasible set first, optimize only within it, and check boundary candidates as well as interior score roots. A second mistake is to use a generic Cholesky factor and assume it preserves every structure: it guarantees positive definiteness, but only a suitably restricted factorization guarantees the required structure.
In practice, evaluate the likelihood using a factorization of the candidate covariance rather than explicitly forming its inverse when possible. This improves numerical stability, but it does not change the mathematical requirements: the candidate must satisfy the structural model, remain positive definite, and meet the appropriate interior or boundary optimality conditions.
Check Your Understanding
Use the likelihood, feasibility conditions, and score formulas to answer these questions.
- Why must positive definiteness be checked separately from nonnegativity of covariance-component coefficients?
- For a linear covariance model \(\Sigma(\theta)=\sum_j\theta_j A_j\), what matrix replaces \(\Sigma_j\) in the score formula?
- In the boundary example, why is a negative score for \(b\) consistent with \(\hat b=0\)?
- What does a Cholesky factorization guarantee, and what does it not guarantee about a desired covariance structure?
- At an interior maximum, which score equations must hold, and why might they fail to characterize a constrained maximum on its boundary?