coef.gglasso: get coefficients or make coefficient predictions from an...

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/tools.R

Description

Computes the coefficients at the requested values for lambda from a fitted gglasso object.

Usage

1
2
## S3 method for class 'gglasso'
coef(object, s = NULL, ...)

Arguments

object

fitted gglasso model object.

s

value(s) of the penalty parameter lambda at which predictions are required. Default is the entire sequence used to create the model.

...

not used. Other arguments to predict.

Details

s is the new vector at which predictions are requested. If s is not in the lambda sequence used for fitting the model, the coef function will use linear interpolation to make predictions. The new values are interpolated using a fraction of coefficients from both left and right lambda indices.

Value

The coefficients at the requested values for lambda.

Author(s)

Yi Yang and Hui Zou
Maintainer: Yi Yang <yi.yang6@mcgill.ca>

References

Yang, Y. and Zou, H. (2015), “A Fast Unified Algorithm for Computing Group-Lasso Penalized Learning Problems,” Statistics and Computing. 25(6), 1129-1141.
BugReport: https://github.com/emeryyi/gglasso

See Also

predict.gglasso method

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# load gglasso library
library(gglasso)

# load data set
data(colon)

# define group index
group <- rep(1:20,each=5)

# fit group lasso
m1 <- gglasso(x=colon$x,y=colon$y,group=group,loss="logit")

# the coefficients at lambda = 0.01 and 0.02
coef(m1,s=c(0.01,0.02))

gglasso documentation built on March 18, 2020, 9:07 a.m.