Tutorials › Multivariate Statistics (Graduate) › L1-Penalized Likelihood And The Graphical Lasso

Sparse Precision and Graphical Models · Tutorial 832 of 975

L1-Penalized Likelihood And The Graphical Lasso

Learn how the graphical lasso combines Gaussian likelihood with an off-diagonal sparsity penalty, and how to read its estimated precision matrix as a candidate graph.

Advanced 10 min read

What You'll Learn

  • Write the graphical lasso objective on the positive-definite precision-matrix domain
  • Relate the objective to the Gaussian log-likelihood and distinguish penalty conventions
  • Explain why off-diagonal entries are penalized while diagonal entries are not
  • Prove convexity and identify the exact solution when the sample covariance is diagonal
  • Translate nonzero estimated precision entries into candidate graph edges
  • Recognize what a fitted sparse graph does and does not establish

From a Gaussian Likelihood to a Sparse Graph

In a multivariate Gaussian model, the precision matrix is the inverse covariance matrix. Its off-diagonal entries encode conditional relationships: for a nonsingular multivariate Gaussian distribution, two variables are conditionally independent given all the others exactly when the corresponding precision entry is zero. This makes precision estimation a route to estimating a graph, but in high dimensions an unrestricted estimate can be unstable or unavailable. The graphical lasso adds a penalty that encourages a sparse pattern of off-diagonal entries.

The purpose of the penalty is not simply to shrink every entry of the precision matrix. The diagonal entries describe conditional precision (and must remain part of the likelihood fit); the potential graph edges are represented by the off-diagonal entries. The distinction is built into the objective.

Definition: Let \(X_1,\ldots,X_n\) be independent observations from \(N_p(\mu,\Sigma)\), with \(\Sigma\) positive definite, and let \(\Theta=\Sigma^{-1}\) be the precision matrix. Write \(\bar X=n^{-1}\sum_{k=1}^n X_k\) and \(S=n^{-1}\sum_{k=1}^n(X_k-\bar X)(X_k-\bar X)^T\). Under the convention used here, the graphical lasso estimate is a minimizer over symmetric positive-definite \(\Theta\) of $$ F_\lambda(\Theta)=\operatorname{tr}(S\Theta)-\log\det(\Theta)+\lambda\sum_{i\ne j}|\theta_{ij}|,\qquad \lambda\ge 0. $$

The displayed convention counts both \(\theta_{ij}\) and \(\theta_{ji}\), since \(\Theta\) is symmetric. Thus its penalty is also \(2\lambda\sum_{i<j}|\theta_{ij}|\). Other presentations may use a different coefficient or count each pair once; changing that convention changes the numerical interpretation of the tuning parameter. The diagonal terms \(\theta_{ii}\) are deliberately absent from the penalty.

To connect this objective to likelihood, the Gaussian log-likelihood after estimating the mean by \(\bar X\), up to terms not depending on \(\Theta\), is $$ \ell(\Theta)=\frac{n}{2}\left\{\log\det(\Theta)-\operatorname{tr}(S\Theta)\right\}. $$ Consequently, maximizing this likelihood with an added penalty on off-diagonal entries is equivalent, after dividing by \(n/2\) and absorbing the scaling into the penalty parameter, to minimizing \(F_\lambda\). This formulation also makes sense when \(S\) is singular, as can occur when the number of variables exceeds the sample size; the optimization remains over positive-definite matrices, and the penalty regularizes the fit.

What the Objective Is Balancing

The trace term measures the fit of a candidate precision matrix to the empirical covariance, while \(-\log\det(\Theta)\) is the other likelihood contribution. The penalty charges for nonzero off-diagonal entries. A larger \(\lambda\) makes those entries more costly, so the fitted matrix is encouraged to contain fewer potential edges. The penalty does not require an entry to be zero; rather, it changes the balance between fit and complexity.

The admissible domain matters. A precision matrix must be symmetric positive definite, written \(\Theta\succ0\); otherwise it cannot be the inverse of a nonsingular covariance matrix, and \(\log\det(\Theta)\) is not defined as a real log-determinant. In particular, the graphical lasso does not optimize over arbitrary collections of entries and then interpret the result as a precision matrix.

Theorem: For \(\lambda\ge0\), \(F_\lambda\) is strictly convex on the convex domain of symmetric positive-definite matrices. Therefore, if a minimizer exists, it is unique.

Proof. The trace term is linear in \(\Theta\), and the sum of absolute values is convex. It remains to show that \(-\log\det(\Theta)\) is strictly convex. Take any symmetric nonzero matrix \(H\) and any interval of real \(t\) on which \(\Theta+tH\succ0\). Differentiating along this line gives $$ \frac{d}{dt}\{-\log\det(\Theta+tH)\}=-\operatorname{tr}\{(\Theta+tH)^{-1}H\}, $$ and differentiating again gives $$ \frac{d^2}{dt^2}\{-\log\det(\Theta+tH)\} =\operatorname{tr}\{(\Theta+tH)^{-1}H(\Theta+tH)^{-1}H\}. $$ Set \(A=(\Theta+tH)^{-1/2}H(\Theta+tH)^{-1/2}\). This is symmetric and nonzero, and the second derivative equals \(\operatorname{tr}(A^2)\), the sum of the squares of the eigenvalues of \(A\). It is strictly positive. Thus \(-\log\det\) is strictly convex along every nonconstant line segment in the domain. Adding a linear function and a convex penalty preserves strict convexity, proving the claim. \(\square\)

Worked Example: An Exact Fit When the Sample Covariance Is Diagonal

Suppose \(p=2\), \(S=\begin{pmatrix}4&0\\0&1\end{pmatrix}\), and \(\lambda=0.3\). We can identify the global minimizer without solving a general optimization problem. For a positive-definite \(\Theta\), let \(A=S^{1/2}\Theta S^{1/2}\). Then \(A\succ0\), \(\operatorname{tr}(S\Theta)=\operatorname{tr}(A)\), and \(\log\det(\Theta)=\log\det(A)-\log\det(S)\).

If \(a_1,a_2\) are the positive eigenvalues of \(A\), then $$ \operatorname{tr}(S\Theta)-\log\det(\Theta) =\log\det(S)+\sum_{j=1}^2(a_j-\log a_j). $$ For every \(x>0\), \(x-\log x\ge1\), with equality only at \(x=1\). Also, the penalty is nonnegative. Hence $$ F_\lambda(\Theta)\ge \log\det(S)+2=\log(4)+2. $$ Equality requires \(A=I\), or \(\Theta=S^{-1}=\begin{pmatrix}0.25&0\\0&1\end{pmatrix}\); its off-diagonal penalty is zero, so it attains the lower bound and is the minimizer. In this case, the fitted graph has no edge between the two variables. This argument applies generally when \(S\) is positive diagonal: the minimizer is \(S^{-1}\) for every \(\lambda\ge0\).

Off-Diagonal Penalization and Graph Interpretation

For a fitted matrix \(\hat\Theta\), the usual graph has one node for each variable and an undirected edge between distinct nodes \(i\) and \(j\) whenever \(\hat\theta_{ij}\ne0\). Symmetry ensures that this is one edge, not two directed edges. The zero pattern is the graph structure; the sign and magnitude of a retained entry also describe the fitted conditional association.

For a Gaussian model, the population partial correlation between variables \(i\) and \(j\), conditional on the remaining variables, is $$ \rho_{ij\mid -\{i,j\}}=-\frac{\theta_{ij}}{\sqrt{\theta_{ii}\theta_{jj}}}. $$ Thus a zero off-diagonal precision entry corresponds to zero partial correlation and conditional independence. A nonzero entry in an estimated precision matrix yields a candidate edge, not by itself proof that the corresponding population edge exists. Sampling variability, tuning choices, and model assumptions all matter for that interpretation.

Leaving diagonal entries unpenalized has a structural reason: they are not edges. They are positive diagonal components needed to describe the precision matrix and its conditional variances. Penalizing all entries would charge for these components as well, changing the estimator and potentially distorting the fitted scale. In contrast, the off-diagonal penalty targets the part of the matrix used to encode graph connections.

Worked Example: Counting the Penalty Correctly

Let \(S=\begin{pmatrix}1&0.4\\0.4&1\end{pmatrix}\), \(\lambda=0.5\), and compare the candidate matrices \(I\) and \(S^{-1}\). Since \(\det(S)=1-0.4^2=0.84\), $$ S^{-1}=\frac{1}{0.84}\begin{pmatrix}1&-0.4\\-0.4&1\end{pmatrix} =\begin{pmatrix}1.190476&-0.476190\\-0.476190&1.190476\end{pmatrix}. $$ Both candidates are positive definite. For \(\Theta=I\), \(\operatorname{tr}(S\Theta)=2\), \(\log\det(\Theta)=0\), and the penalty is zero, so \(F_\lambda(I)=2\).

For \(\Theta=S^{-1}\), \(\operatorname{tr}(S\Theta)=2\), and \(-\log\det(\Theta)=\log(0.84)\). The two off-diagonal entries are both counted, so the penalty is $$ 0.5\left(|-0.476190|+|-0.476190|\right)=0.476190. $$ Therefore \(F_\lambda(S^{-1})=2+\log(0.84)+0.476190\approx2.301837\). The identity candidate has the lower objective of these two. This comparison does not establish which candidate minimizes over all positive-definite matrices; it illustrates exactly how the likelihood and the twice-counted off-diagonal penalty enter the objective.

Worked Example: Reading a Three-Variable Candidate Graph

Suppose a fitted precision matrix is $$ \hat\Theta=\begin{pmatrix}2&-0.6&0\\-0.6&1.5&0.3\\0&0.3&1\end{pmatrix}. $$ It is symmetric and strictly diagonally dominant with positive diagonal entries: the diagonal entries exceed the sums of the absolute off-diagonal entries in their rows by \(1.4\), \(0.6\), and \(0.7\), respectively. By the eigenvalue bound for a symmetric strictly diagonally dominant matrix, it is positive definite and is a valid precision-matrix candidate.

The nonzero off-diagonal entries are \(\hat\theta_{12}=-0.6\) and \(\hat\theta_{23}=0.3\); \(\hat\theta_{13}=0\). Its candidate graph therefore has edges \(1\!-\!2\) and \(2\!-\!3\), but not \(1\!-\!3\). The corresponding fitted partial correlations are $$ \hat\rho_{12\mid 3}=-\frac{-0.6}{\sqrt{2(1.5)}}=\frac{0.6}{\sqrt3}\approx0.3464, \qquad \hat\rho_{23\mid 1}=-\frac{0.3}{\sqrt{1.5(1)}}\approx-0.2449. $$ These values are conditional associations in the fitted Gaussian model. The absent \(1\!-\!3\) edge means the fitted precision entry is zero; it should not be confused with the claim that variables 1 and 3 are marginally uncorrelated.

Why the Formulation Matters

The graphical lasso turns a covariance-based likelihood into a structured precision estimate by making small off-diagonal entries costly. Its output is useful because a sparse matrix is easier to interpret as a network than a dense one, and because regularization can stabilize estimation when the number of variables is large relative to the sample size. The method is still an estimator: its selected edges depend on the observed data and the penalty strength.

A common mistake is to write \(\lambda\sum_{i,j}|\theta_{ij}|\) and call it the standard graphical-lasso penalty. That expression penalizes the diagonal too. The correction is to specify the index set explicitly, such as \(\sum_{i\ne j}|\theta_{ij}|\), or to use \(2\sum_{i<j}|\theta_{ij}|\) under the convention used here. Another mistake is to treat every nonzero fitted entry as a confirmed population edge. The estimate proposes a graph; inferential or support-recovery claims require further justification beyond the objective alone.

Key takeaway: The graphical lasso minimizes a Gaussian likelihood loss plus an \(L_1\) penalty on off-diagonal precision entries over positive-definite matrices. Its nonzero estimated entries define candidate edges, while its unpenalized diagonal entries remain essential to the precision-matrix fit.

Check Your Understanding

Use the objective and graph interpretation to answer these questions.

  1. Why is the graphical lasso optimization restricted to symmetric positive-definite matrices?
  2. Under the convention in this tutorial, how does \(\lambda\sum_{i\ne j}|\theta_{ij}|\) relate to a sum over \(i<j\)?
  3. What feature of the Gaussian model does a zero off-diagonal precision entry represent?
  4. If \(S\) is positive diagonal, what is the graphical lasso minimizer, and why is its penalty zero?
  5. Why does a nonzero estimated precision entry indicate a candidate edge rather than establish a population edge?
Clinical Biostats