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

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

Description

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

Usage

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

Arguments

object

fitted HDtweedie 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)

Wei Qian, Yi Yang and Hui Zou
Maintainer: Wei Qian <weiqian@stat.umn.edu>

References

Qian, W., Yang, Y., Yang, Y. and Zou, H. (2013), “Tweedie's Compound Poisson Model With Grouped Elastic Net,” submitted to Journal of Computational and Graphical Statistics.

See Also

predict.HDtweedie method

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# load HDtweedie library
library(HDtweedie)

# load data set
data(auto)

# fit the lasso
m0 <- HDtweedie(x=auto$x,y=auto$y,p=1.5)

# the coefficients at lambda = 0.01
coef(m0,s=0.01)

# define group index
group1 <- c(rep(1,5),rep(2,7),rep(3,4),rep(4:14,each=3),15:21)

# fit grouped lasso
m1 <- HDtweedie(x=auto$x,y=auto$y,group=group1,p=1.5)

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

emeryyi/hdtweedie documentation built on May 16, 2019, 5:06 a.m.