Tutorials › Econometrics (Graduate) › Nodewise Lasso for Approximate Precision Matrices

High-Dimensional Econometrics · Tutorial 923 of 952

Nodewise Lasso for Approximate Precision Matrices

Derive the nodewise lasso precision-matrix estimate, understand its sparsity and design requirements, and calculate its entries from hypothetical data.

Advanced 12 min read

What You'll Learn

  • Define the nodewise regression coefficients and their connection to a row of the population precision matrix.
  • Derive the residual-based correction used to estimate the variance for each nodewise regression.
  • Calculate a nodewise lasso regression and the resulting approximate precision-matrix row.
  • State the sparsity, design, and penalty conditions that support the approximation.
  • Recognize why estimated rows may not form a symmetric or positive-definite matrix.

Why Estimate Precision-Matrix Rows by Regression?

The debiased lasso uses an approximate inverse of the design covariance matrix to correct regularization bias. When the number of covariates \(p\) is large relative to the sample size \(n\), directly inverting the empirical covariance matrix may be impossible or unstable. Nodewise lasso provides another route: estimate one row at a time by regressing each covariate on all the others, using an \(\ell_1\) penalty to encourage sparse regressions.

The key connection is structural. If a covariate can be well predicted by a small number of the remaining covariates, its regression residual provides a direction that is nearly orthogonal to those other covariates. Rescaling that direction gives an approximate inverse-covariance row. This construction is useful only when the nodewise regressions are sufficiently sparse and the design supports their estimation.

Population Regression and the Precision Matrix

Let \(X\) be a centered \(n \times p\) design matrix, with column \(x_j\) containing observations on covariate \(j\). Write \(\Sigma\) for the population covariance matrix of the covariates, and suppose it is nonsingular. For each \(j\), define the population linear regression of covariate \(j\) on all the others. Its coefficient vector is \(\gamma_j = \Sigma_{-j,-j}^{-1}\Sigma_{-j,j}\), where \(-j\) means all indices except \(j\). Its residual variance is \(\tau_j^2 = \Sigma_{jj}-\Sigma_{j,-j}\gamma_j\).

Definition: The nodewise regression for index \(j\) regresses covariate \(j\) on the other \(p-1\) covariates. Its coefficient vector is \(\gamma_j\), and its residual variance is \(\tau_j^2\). The population precision matrix is \(\Omega=\Sigma^{-1}\). The \(j\)th row of \(\Omega\) has entry \(1/\tau_j^2\) in position \(j\) and entries \(-\gamma_j/\tau_j^2\) in the other positions.

To see the connection, place a 1 in position \(j\) and the entries of \(-\gamma_j\) in the other positions, forming a vector \(v_j\). The population regression equations imply that \(\Sigma v_j\) is zero outside position \(j\): for the other covariates, the residual is uncorrelated with each regressor. The \(j\)th entry of \(\Sigma v_j\) is the residual variance \(\tau_j^2\). Therefore \(\Sigma(v_j/\tau_j^2)=e_j\), where \(e_j\) is 1 in position \(j\) and 0 elsewhere. Multiplying by \(\Sigma^{-1}\) shows \(v_j/\tau_j^2=\Omega e_j\), the \(j\)th column of \(\Omega\). Since \(\Omega\) is symmetric, this is also its \(j\)th row, written as a vector.

The Sample Nodewise Lasso

In the sample, estimate each population regression with a lasso regression. Define the empirical covariance matrix as \(\hat\Sigma=X^\top X/n\). For each \(j\), let \(X_{-j}\) denote \(X\) with column \(j\) removed, and solve

$$ \hat\gamma_j = \arg\min_{\gamma\in\mathbb{R}^{p-1}} \left\{ \frac{1}{2n}\|x_j-X_{-j}\gamma\|_2^2 +\lambda_j\|\gamma\|_1 \right\}. $$

Let \(\hat r_j=x_j-X_{-j}\hat\gamma_j\) be the residual vector. A residual-based scale estimate includes a penalty correction:

$$ \hat\tau_j^2 = \frac{1}{n}\|\hat r_j\|_2^2 +\lambda_j\|\hat\gamma_j\|_1. $$

The resulting estimate of row \(j\) places \(1/\hat\tau_j^2\) in position \(j\), and \(-\hat\gamma_j/\hat\tau_j^2\) in the other positions. Collecting these rows gives an approximate precision-matrix estimate, often denoted \(\hat\Omega\). If the nodewise coefficients are sparse, each row can be estimated without solving a single high-dimensional matrix-inversion problem.

Why the correction appears: Under the lasso objective above, the Karush–Kuhn–Tucker conditions imply \(\hat\Sigma_{-j,j}-\hat\Sigma_{-j,-j}\hat\gamma_j=\lambda_j z_j\), where each coordinate of \(z_j\) is a subgradient of the \(\ell_1\) norm. For nonzero coefficients, the corresponding coordinate of \(z_j\) is the coefficient’s sign. Consequently,
$$ \frac{x_j^\top \hat r_j}{n} = \frac{\|\hat r_j\|_2^2}{n} +\hat\gamma_j^\top\frac{X_{-j}^\top\hat r_j}{n} = \frac{\|\hat r_j\|_2^2}{n} +\lambda_j\|\hat\gamma_j\|_1 = \hat\tau_j^2. $$

Thus the estimated row has a normalized product with \(x_j\) equal to 1. Its products with the other design columns are controlled by the lasso penalty rather than being exactly zero. This is why the result is called an approximate inverse.

Worked Example: Calculating a Row from Four Observations

Worked Example: Calculating a Row from Four Observations

Suppose a hypothetical centered data set has four observations and two standardized covariates: \(x_1=(1,-1,1,-1)^\top\) and \(x_2=(1.4,0.2,-0.2,-1.4)^\top\). Their empirical covariance matrix, using the \(1/n\) convention, is \(\hat\Sigma=\begin{pmatrix}1&0.6\\0.6&1\end{pmatrix}\). Estimate the first row using \(\lambda_1=0.2\).

There is one regressor in the nodewise regression. Its lasso objective is \(\frac{1}{2}\hat\Sigma_{22}\gamma^2-\hat\Sigma_{21}\gamma+\lambda_1|\gamma|\), up to a term that does not depend on \(\gamma\). Since \(\hat\Sigma_{22}=1\) and \(\hat\Sigma_{21}=0.6\), the positive-coefficient solution is \(\hat\gamma_1=0.6-0.2=0.4\). It satisfies the lasso condition because it is positive and its derivative is \(0.4-0.6+0.2=0\).

The residuals are \(x_1-0.4x_2=(0.44,-1.08,1.08,-0.44)^\top\). Therefore \(\|\hat r_1\|_2^2/n=(0.44^2+1.08^2+1.08^2+0.44^2)/4=2.72/4=0.68\). The corrected scale is \(\hat\tau_1^2=0.68+0.2(0.4)=0.76\).

The approximate first row is \((1,-0.4)/0.76=(1.316,-0.5263)\), to four significant figures. As a check, multiplying the row by \(\hat\Sigma\) gives \((1,0.2632)\): the diagonal product is 1, while the off-diagonal product is \(0.2/0.76\), not zero. The row is therefore an approximate, not exact, inverse-covariance row.

Conditions for the Approximation

Nodewise lasso does not make a dense regression estimable just by adding a penalty. Its performance depends on assumptions about the covariate distribution, the design, and the sparsity of the nodewise regressions. In a common high-dimensional regime, the number of covariates may exceed the sample size, so an ordinary inverse of \(\hat\Sigma\) does not exist. The following conditions describe the basic requirements; precise theorems vary in their details.

  • Nonsingular population covariance: \(\Sigma\) has eigenvalues bounded away from zero and infinity. This prevents the target precision matrix from being arbitrarily ill-conditioned.
  • Controlled design for each regression: the empirical design must satisfy a compatibility or restricted-eigenvalue condition on the sparse directions relevant to each nodewise regression. These conditions prevent distinct sparse coefficient vectors from producing nearly indistinguishable fitted values.
  • Sparse or approximately sparse regressions: each \(\gamma_j\) has relatively few important entries. If \(s_j\) denotes its number of nonzero entries, the maximum row sparsity \(s_{\max}=\max_j s_j\) must grow slowly enough relative to \(n\) and \(p\). Approximate sparsity is also possible when the small coefficients have a sufficiently controlled tail.
  • Appropriate penalty: \(\lambda_j\) is typically chosen on the order of \(\sqrt{\log(p)/n}\), with constants or scaling adjusted to the noise and covariate scales. This size controls the maximum empirical correlation between a regression residual and the candidate regressors.

For example, standard lasso bounds under suitable design and score conditions give a prediction error of order \(s_j\lambda_j^2\) and an \(\ell_1\) coefficient error of order \(s_j\lambda_j\), up to constants. These rates explain why \(s_j\log(p)/n\) should be small for prediction error to vanish, and why stronger sparsity control can be needed when accurate coefficient or inverse-matrix estimates are required. These are rate guides, not universal guarantees: the exact assumptions and error bounds depend on the design and the target.

Worked Example: Checking a Sparsity Rate

Consider a hypothetical design with \(n=1000\), \(p=2000\), and at most \(s_{\max}=4\) nonzero coefficients in any population nodewise regression. Using the conventional order \(\lambda=\sqrt{\log(p)/n}\), with the natural logarithm, gives \(\lambda=\sqrt{\log(2000)/1000}=\sqrt{7.601/1000}\approx0.08718\).

The prediction-rate quantity is \(s_{\max}\lambda^2=4(7.601/1000)=0.03040\), which is small. The coefficient \(\ell_1\)-rate quantity is \(s_{\max}\lambda=4(0.08718)=0.3487\), which is not especially small. These calculations suggest that the prediction error rate is more favorable than the coefficient \(\ell_1\)-error rate at these dimensions. They do not prove either bound: a suitable design condition and control of the lasso score are also needed.

Worked Example: A Three-Covariate Nodewise Regression

Worked Example: A Three-Covariate Nodewise Regression

Suppose hypothetical centered, standardized data have empirical covariance matrix \(\hat\Sigma=\begin{pmatrix}1&0.6&0.5\\0.6&1&0.2\\0.5&0.2&1\end{pmatrix}\), and use \(\lambda_1=0.1\) to regress covariate 1 on covariates 2 and 3. The matrix is positive definite (its determinant is \(0.47\)), so these stated empirical covariances are internally consistent.

The correlations of covariates 2 and 3 with covariate 1 are \((0.6,0.5)^\top\), and the covariance matrix of the two regressors is \(\begin{pmatrix}1&0.2\\0.2&1\end{pmatrix}\). For a solution with both coefficients positive, the lasso conditions are \(\begin{pmatrix}1&0.2\\0.2&1\end{pmatrix}\hat\gamma_1=(0.6,0.5)^\top-(0.1,0.1)^\top=(0.5,0.4)^\top\). Solving gives \(\hat\gamma_{12}=0.4375\) and \(\hat\gamma_{13}=0.3125\); both are positive, as assumed.

The corrected scale is \(\hat\tau_1^2=1-(0.6)(0.4375)-(0.5)(0.3125)=1-0.2625-0.15625=0.58125\). Equivalently, the residual variance before correction is \(0.58125-0.1(0.4375+0.3125)=0.50625\), and adding the penalty correction gives \(0.58125\). The approximate first row is \((1,-0.4375,-0.3125)/0.58125=(1.720,-0.7527,-0.5376)\).

What the Estimate Does—and Does Not—Guarantee

Nodewise lasso produces one regression-based estimate for each row. Those regressions are solved separately, so the resulting \(\hat\Omega\) need not be exactly symmetric. It is also not guaranteed to be positive definite. Neither property follows merely from the row construction. Some applications symmetrize the estimate, but the choice of symmetrization is an additional step; it does not turn the original regression estimates into exact inverse rows.

Sparsity has a useful interpretation when covariates are jointly Gaussian: a zero off-diagonal entry of the population precision matrix corresponds to conditional independence of the associated pair given the other covariates. More generally, a sparse nodewise regression means that covariate \(j\) is linearly explained by a relatively small subset of the others. Without the relevant distributional assumptions, a zero regression coefficient should not automatically be read as conditional independence.

In debiased-lasso procedures, the estimated rows supply directions used to reduce the regularization bias of the original lasso estimate. Their quality matters because errors in the approximate inverse can affect the correction. Nodewise lasso therefore does not eliminate high-dimensional assumptions: it replaces direct covariance inversion with a collection of sparse regression problems whose errors must still be controlled.

Common Mistakes

  • Using only the raw residual variance. The lasso KKT conditions imply the correction \(\lambda_j\|\hat\gamma_j\|_1\). Omitting it generally changes the scale and the resulting row.
  • Calling the estimate an exact inverse. The products with non-target columns are controlled by the penalty, not forced to zero. Check the off-diagonal products before describing the row as an exact inverse.
  • Assuming sparsity alone is enough. Sparse nodewise regressions still require a design condition and suitable control of empirical score correlations. A small support does not guarantee stable estimation if the regressors are too collinear.
  • Assuming the assembled estimate is symmetric or positive definite. Rowwise regression does not impose either constraint. Do not treat those properties as automatic.
Key takeaway: Regress each covariate on the others with an \(\ell_1\) penalty, add the penalty correction to the residual variance, and scale the vector with a 1 at the target coordinate and negative fitted coefficients elsewhere. This gives an approximate precision-matrix row when the nodewise regressions are sparse and the design is well behaved.

Check Your Understanding

Use the definitions and calculations above to answer the following questions.

  1. Why is the nodewise regression residual variance adjusted by \(\lambda_j\|\hat\gamma_j\|_1\)?
  2. If a nodewise regression has \(\hat\gamma_j=(0.3,0)\) and \(\hat\tau_j^2=0.75\), what are the entries of its approximate inverse row at the target coordinate and the two other coordinates?
  3. What does the KKT condition imply about the product of the estimated row with a non-target design column?
  4. Why can a collection of separately estimated nodewise rows fail to be symmetric?
  5. Which additional requirements, besides sparsity, support the nodewise lasso approximation?
Clinical Biostats