Using the robsel package

This vignette illustrate the basic usage of the robsel package to estimate of the regularization parameter for Graphical Lasso.

Data

We use a 100-by-5 matrix from generate from normal distribution.

x <- matrix(rnorm(100*5),ncol=5)

Using robsel functions

Estimate of the regularization parameter for Graphical Lasso

The function robsel estimates \(\lambda\), a regularization parameter for Graphical Lasso at a prespecified confidence level \(\alpha\).

library(robsel)
lambda <- robsel(x)
lambda
#> [1] 0.1400612

Graphical Lasso algorithm with \(\lambda\) from Robust Selection

The function robsel.glasso returns estimates a sparse inverse covariance matrix using Graphical Lasso with regularization parameter estimated from Robust Selection

A <- robsel.glasso(x)
A
#> $alpha
#> [1] 0.9
#> 
#> $lambda
#> [1] 0.1555939
#> 
#> $Sigma
#> $Sigma[[1]]
#>          [,1]     [,2]     [,3]     [,4]      [,5]
#> [1,] 1.490699 0.000000 0.000000 0.000000 0.0000000
#> [2,] 0.000000 1.145855 0.000000 0.000000 0.0000000
#> [3,] 0.000000 0.000000 1.023998 0.000000 0.0000000
#> [4,] 0.000000 0.000000 0.000000 0.973284 0.0000000
#> [5,] 0.000000 0.000000 0.000000 0.000000 0.9183441
#> 
#> 
#> $Omega
#> $Omega[[1]]
#>           [,1]     [,2]      [,3]     [,4]     [,5]
#> [1,] 0.6708262 0.000000 0.0000000 0.000000 0.000000
#> [2,] 0.0000000 0.872711 0.0000000 0.000000 0.000000
#> [3,] 0.0000000 0.000000 0.9765643 0.000000 0.000000
#> [4,] 0.0000000 0.000000 0.0000000 1.027449 0.000000
#> [5,] 0.0000000 0.000000 0.0000000 0.000000 1.088916

Use RobSel with multiple prespecified confidence levels

We can use multiple \(\alpha\) simultaneously with Robust Selection

alphas <- c(0.1, 0.5, 0.9)
lambdas <- robsel(x, alphas)
lambdas
#> [1] 0.3001802 0.2082932 0.1435797
robsel.fits <- robsel.glasso(x, alphas)
robsel.fits
#> $alpha
#> [1] 0.1 0.5 0.9
#> 
#> $lambda
#> [1] 0.3279065 0.2106773 0.1429671
#> 
#> $Sigma
#> $Sigma[[1]]
#>          [,1]     [,2]     [,3]     [,4]     [,5]
#> [1,] 1.663012 0.000000 0.000000 0.000000 0.000000
#> [2,] 0.000000 1.318167 0.000000 0.000000 0.000000
#> [3,] 0.000000 0.000000 1.196311 0.000000 0.000000
#> [4,] 0.000000 0.000000 0.000000 1.145597 0.000000
#> [5,] 0.000000 0.000000 0.000000 0.000000 1.090657
#> 
#> $Sigma[[2]]
#>          [,1]     [,2]     [,3]     [,4]      [,5]
#> [1,] 1.545783 0.000000 0.000000 0.000000 0.0000000
#> [2,] 0.000000 1.200938 0.000000 0.000000 0.0000000
#> [3,] 0.000000 0.000000 1.079082 0.000000 0.0000000
#> [4,] 0.000000 0.000000 0.000000 1.028367 0.0000000
#> [5,] 0.000000 0.000000 0.000000 0.000000 0.9734276
#> 
#> $Sigma[[3]]
#>          [,1]     [,2]     [,3]      [,4]      [,5]
#> [1,] 1.478072 0.000000 0.000000 0.0000000 0.0000000
#> [2,] 0.000000 1.133228 0.000000 0.0000000 0.0000000
#> [3,] 0.000000 0.000000 1.011371 0.0000000 0.0000000
#> [4,] 0.000000 0.000000 0.000000 0.9606572 0.0000000
#> [5,] 0.000000 0.000000 0.000000 0.0000000 0.9057174
#> 
#> 
#> $Omega
#> $Omega[[1]]
#>           [,1]     [,2]      [,3]      [,4]      [,5]
#> [1,] 0.6013187 0.000000 0.0000000 0.0000000 0.0000000
#> [2,] 0.0000000 0.758629 0.0000000 0.0000000 0.0000000
#> [3,] 0.0000000 0.000000 0.8359032 0.0000000 0.0000000
#> [4,] 0.0000000 0.000000 0.0000000 0.8729076 0.0000000
#> [5,] 0.0000000 0.000000 0.0000000 0.0000000 0.9168787
#> 
#> $Omega[[2]]
#>           [,1]      [,2]      [,3]      [,4]     [,5]
#> [1,] 0.6469215 0.0000000 0.0000000 0.0000000 0.000000
#> [2,] 0.0000000 0.8326824 0.0000000 0.0000000 0.000000
#> [3,] 0.0000000 0.0000000 0.9267141 0.0000000 0.000000
#> [4,] 0.0000000 0.0000000 0.0000000 0.9724151 0.000000
#> [5,] 0.0000000 0.0000000 0.0000000 0.0000000 1.027298
#> 
#> $Omega[[3]]
#>           [,1]     [,2]      [,3]     [,4]     [,5]
#> [1,] 0.6765569 0.000000 0.0000000 0.000000 0.000000
#> [2,] 0.0000000 0.882435 0.0000000 0.000000 0.000000
#> [3,] 0.0000000 0.000000 0.9887565 0.000000 0.000000
#> [4,] 0.0000000 0.000000 0.0000000 1.040954 0.000000
#> [5,] 0.0000000 0.000000 0.0000000 0.000000 1.104097