Graphical Lasso

Hurile BorjiginHurile Borjigin2025-10-07

Graphical Lasso

A. Covariance Matrix Σ\Sigma

The covariance matrix measure how multiple variables vary together. It is a square matrix, symmetric, with size determined by the number of variables you have. If you have a vector of random variables X=(X1,X2,,Xp)\mathbf{X} = (X_1, X_2, \cdots, X_p), the covariance matrix Σ\Sigma is defined as:

Σ=Cov(X,X)=(Var(X1)Cov(X1,X2)Cov(X1,Xp)Cov(X2,X1)Var(X2)Cov(X2,Xp)Cov(Xp,X1)Cov(Xp,X2)Var(Xp)) \Sigma = Cov(\mathbf{X}, \mathbf{X}) = \begin{pmatrix} Var(X_1) & Cov(X_1, X_2)& \cdots & Cov(X_1, X_p) \\ Cov(X_2, X_1) & Var(X_2) & \cdots & Cov(X_2, X_p)\\ \vdots & \vdots & \ddots & \vdots \\ Cov(X_p, X_1) & Cov(X_p, X_2) & \cdots & Var(X_p)\\ \end{pmatrix}

B. Precision Matrix(Θ=Σ1\Theta = \Sigma^{-1}):

Precision matrix is simply the inverse of the covariance matrix and is written as:

Θ=Σ1\Theta = \Sigma^{-1}

C. Empirical Covariance Matrix S

The empirical covariance(sample covariance matrix) is an estimate of the true covariance matrix based on your actual data. For an observational dataset of (n) samples and (p) variables, your data matrix is:

X=(x1,1x1,2x1,px2,1x2,2x2,pxn,1xn,2xn,p)X = \begin{pmatrix} x_{1,1} & x_{1, 2} & \cdots & x_{1, p}\\ x_{2, 1} & x_{2, 2} & \cdots & x_{2, p}\\ \vdots & \vdots & \ddots & \vdots\\ x_{n, 1} & x_{n, 2} & \cdots & x_{n, p} \end{pmatrix}

It assumes your data is centred(mean-subtracted), empirical covariance matrix SS is computed as:

S=1n1XTXS = \frac{1}{n-1}X^TX

This empirical covariance matrix is our practical tool to infer the covariance structure since the true covariance matrix of whole population is generally unknown.

Graphical Models and Graphical Lasso

A. Gaussian Graphical Model(GGM):

A GGM assumes your multi-dimensional data vector X\mathbf{X} is from a multivariate Gaussian distribution:

XN(Σ)\mathbf{X} \sim \mathcal{N}(\Sigma)

The structure of conditional dependence is captured by the precision matrix:

Thus, the main objective of graphical modelling is estimating Θ\Theta, which reveals conditional independencies.

B. Graphical Lasso:

The graphical lasso(glasso) is an estimator that simultaneously estimates the precision matrix and provides sparsity(many zeros), simplify the graphical structure. Graphical Lasso solves the following optimization problem:

Θ^glasso=argmaxΘ0(logdetΘtr(SΘ)λijΘi,j)\hat{\Theta}{glasso} = \arg\max{\Theta \succ 0} \left(\log\det\Theta - \text{tr}(S\Theta) - \lambda \sum_{i \neq j}|\Theta_{i, j}|\right)

This L1 penalty makes graphical lasso valuable compared to simple precision estimations, specialising in interpolation, dimension reduction, and providing useful graphical network.

Graphical Lasso

Graphical Lasso

A. Covariance Matrix Σ\Sigma

The covariance matrix measure how multiple variables vary together. It is a square matrix, symmetric, with size determined by the number of variables you have. If you have a vector of random variables X=(X1,X2,,Xp)\mathbf{X} = (X_1, X_2, \cdots, X_p), the covariance matrix Σ\Sigma is defined as:

Σ=Cov(X,X)=(Var(X1)Cov(X1,X2)Cov(X1,Xp)Cov(X2,X1)Var(X2)Cov(X2,Xp)Cov(Xp,X1)Cov(Xp,X2)Var(Xp)) \Sigma = Cov(\mathbf{X}, \mathbf{X}) = \begin{pmatrix} Var(X_1) & Cov(X_1, X_2)& \cdots & Cov(X_1, X_p) \\ Cov(X_2, X_1) & Var(X_2) & \cdots & Cov(X_2, X_p)\\ \vdots & \vdots & \ddots & \vdots \\ Cov(X_p, X_1) & Cov(X_p, X_2) & \cdots & Var(X_p)\\ \end{pmatrix}

B. Precision Matrix(Θ=Σ1\Theta = \Sigma^{-1}):

Precision matrix is simply the inverse of the covariance matrix and is written as:

Θ=Σ1\Theta = \Sigma^{-1}

C. Empirical Covariance Matrix S

The empirical covariance(sample covariance matrix) is an estimate of the true covariance matrix based on your actual data. For an observational dataset of (n) samples and (p) variables, your data matrix is:

X=(x1,1x1,2x1,px2,1x2,2x2,pxn,1xn,2xn,p)X = \begin{pmatrix} x_{1,1} & x_{1, 2} & \cdots & x_{1, p}\\ x_{2, 1} & x_{2, 2} & \cdots & x_{2, p}\\ \vdots & \vdots & \ddots & \vdots\\ x_{n, 1} & x_{n, 2} & \cdots & x_{n, p} \end{pmatrix}

It assumes your data is centred(mean-subtracted), empirical covariance matrix SS is computed as:

S=1n1XTXS = \frac{1}{n-1}X^TX

This empirical covariance matrix is our practical tool to infer the covariance structure since the true covariance matrix of whole population is generally unknown.

Graphical Models and Graphical Lasso

A. Gaussian Graphical Model(GGM):

A GGM assumes your multi-dimensional data vector X\mathbf{X} is from a multivariate Gaussian distribution:

XN(Σ)\mathbf{X} \sim \mathcal{N}(\Sigma)

The structure of conditional dependence is captured by the precision matrix:

Thus, the main objective of graphical modelling is estimating Θ\Theta, which reveals conditional independencies.

B. Graphical Lasso:

The graphical lasso(glasso) is an estimator that simultaneously estimates the precision matrix and provides sparsity(many zeros), simplify the graphical structure. Graphical Lasso solves the following optimization problem:

Θ^glasso=argmaxΘ0(logdetΘtr(SΘ)λijΘi,j)\hat{\Theta}{glasso} = \arg\max{\Theta \succ 0} \left(\log\det\Theta - \text{tr}(S\Theta) - \lambda \sum_{i \neq j}|\Theta_{i, j}|\right)

This L1 penalty makes graphical lasso valuable compared to simple precision estimations, specialising in interpolation, dimension reduction, and providing useful graphical network.