Learn R Programming

sglasso (version 1.2.6)

Kh: Extract Sparse Structured Precision Matrices

Description

Function Kh computes the sequence of sparse structured precision matrices estimated by sglasso function.

Usage

Kh(object, rho)

Value

Kh returns a named list containing the sequence of estimated sparse structured precision matrices.

Arguments

object

fitted sglasso object;

rho

a subset of the values of the tuning parameter used in sglasso to compute the solution path. By default, the entire sequence of estimated sparse structured precision matrices is returned.

Author

Luigi Augugliaro
Maintainer: Luigi Augugliaro luigi.augugliaro@unipa.it

See Also

sglasso function.

Examples

Run this code
N <- 100
p <- 5
X <- matrix(rnorm(N * p), N, p)
S <- crossprod(X) / N
mask <- outer(1:p, 1:p, function(i, j) 0.5^abs(i - j))
out.sglasso_path <- sglasso(S, mask, nrho = 5, tol = 1.0e-13)
out.sglasso_path
Kh(out.sglasso_path)
rho <- out.sglasso_path$rho[3]
out.sglasso_single <- sglasso(S, mask, nrho = 1, min_rho = rho, 
   tol = 1.0e-13, algorithm = "ccm")
Kh(out.sglasso_single)

Run the code above in your browser using DataLab