Retrieve coefficients from a fitted "cv.glmgraph" object.

Share:

Description

Retrieve coefficients from a fitted "cv.glmgraph" object based on the chosen regularization parameters from cross validation.

Usage

1
2
## S3 method for class 'cv.glmgraph'
coef(object,s,...)

Arguments

object

Fitted "cv.glmgraph" model object.

s

Either "lambda1.min" or "lambda1.1se". If "lambda1.min" is used, coefficients of best cross validation criteria(minimum "mse" or "mae" if family is "gaussian"; maximum "auc" or minimum "deviance" if family is "binomial") are returned. Otherwise, coefficients based on one-standard error rule are returned. The default value is "lambda1.min".

...

Other parameters to coef

Author(s)

Li Chen <li.chen@emory.edu> , Jun Chen <chen.jun2@mayo.edu>

References

Li Chen. Han Liu. Hongzhe Li. Jun Chen. (2015) glmgraph: Graph-constrained Regularization for Sparse Generalized Linear Models.(Working paper)

See Also

predict.cv.glmgraph,cv.glmgraph

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 set.seed(1234)
 library(glmgraph)
 n <- 100
 p1 <- 10
 p2 <- 90
 p <- p1+p2
 X <- matrix(rnorm(n*p), n,p)
 magnitude <- 1
 ## construct laplacian matrix from adjacency matrix
 A <- matrix(rep(0,p*p),p,p)
 A[1:p1,1:p1] <- 1
 A[(p1+1):p,(p1+1):p] <- 1
 diag(A) <- 0
 diagL <- apply(A,1,sum)
 L <- -A
 diag(L) <- diagL
 btrue <- c(rep(magnitude,p1),rep(0,p2))
 intercept <- 0
 eta <- intercept+X%*%btrue 
 ### gaussian
 Y <- eta+rnorm(n)
 cv.obj <- cv.glmgraph(X,Y,L)
 beta.min <- coef(cv.obj)