Skip to contents

ESL Algorithm 17.2: W = S + lambda I with fixed diagonal; cycle over variables solving the modified lasso W11 beta - s12 + lambda Sign(beta) = 0 by coordinate descent (Eq. 17.26, soft threshold Eq. 17.27), update w12 = W11 beta; then theta_22 = 1/(w22 - w12' beta), theta_12 = -beta theta_22. The nonzero pattern of Theta is the conditional-independence (partial-correlation) network of network psychometrics.

Usage

morie_netcms(data = NULL, S = NULL, lam = 0.1, tol = 1e-08, maxit = 500)

Arguments

data

Optional data matrix (sample covariance used as S).

S

Optional covariance matrix (overrides data).

lam

L1 penalty lambda >= 0.

tol, maxit

Coordinate-descent controls.

Value

A list with elements precision, covariance_fit, adjacency, partial_correlations, n_edges, lam, method.

References

Hastie, T., Tibshirani, R. and Friedman, J. (2009). The Elements of Statistical Learning, 2nd ed. Springer, Sec. 17.3.2. Friedman, J., Hastie, T. and Tibshirani, R. (2008). Biostatistics, 9, 432-441. Epskamp, S., Borsboom, D. and Fried, E. I. (2018). Behavior Research Methods, 50, 195-212.

Examples

set.seed(8)
X <- matrix(rnorm(200 * 4), 200, 4); X[, 2] <- X[, 1] + rnorm(200, sd = 0.5)
morie_netcms(data = X, lam = 0.1)$adjacency
#>      [,1] [,2] [,3] [,4]
#> [1,]    0    1    0    0
#> [2,]    1    0    0    0
#> [3,]    0    0    0    0
#> [4,]    0    0    0    0