listToMatrix: Obtain a sparse matrix of the coefficients of the path

Description Usage Arguments Details Value See Also Examples

View source: R/utilities.R

Description

Obtain a sparse matrix of the coefficients of the path

Usage

1
listToMatrix(x, row = c("covariates", "lambda"))

Arguments

x

HCgglasso object

row

"lambda" or "covariates". If row="covariates", each row of the output matrix represents a covariates else ff row="lambda", it represents a value of lambda.

Details

This functions can be used with a HCgglasso object to obtain a matrix with all estimated coefficients for the p original variables. In case of overlapping groups, coefficients from repeated variables are summed.

Value

a sparse matrix containing the estimated coefficients for different values of lambda

See Also

HCgglasso, overlapgglasso

Examples

1
2
3
4
X=simuBlockGaussian(50,12,5,0.7)
y=drop(X[,c(2,7,12)]%*%c(2,2,-2)+rnorm(50,0,0.5))
res=HCgglasso(X,y)
beta=listToMatrix(res)

HCgglasso documentation built on May 2, 2019, 4:54 p.m.