coef.l2boost: Extract model coefficients from an l2boost model object at...

Description Usage Arguments Value See Also Examples

View source: R/coef.l2boost.R

Description

By default, coef.l2boost returns the model (beta) coefficients from the last step, M of the l2boost model. For a cv.l2boost object, the default returns the coefficients from model at the cross-validation optimal step (m = opt.step return value).

Coefficients from alternative steps along the solution can be obtained using the m parameter.

Usage

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

Arguments

object

an l2boost fit object (l2boost or cv.l2boost)

m

the iteration number within the l2boost solution path. If m=NULL, the coefficients are obtained from the last iteration M.

...

other arguments passed to generic function.

Value

vector of coefficient estimates for l2boost objects. The estimates correspond to the given iteration number m, or the final step M.

See Also

coef and l2boost, cv.l2boost and predict.l2boost methods of l2boost.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#--------------------------------------------------------------------------
# Example: Diabetes data 
#  
# See Efron B., Hastie T., Johnstone I., and Tibshirani R. 
# Least angle regression. Ann. Statist., 32:407-499, 2004.
data(diabetes, package='l2boost')

object <- l2boost(diabetes$x,diabetes$y, M=1000, nu=.01)
coef(object)

# At the m=500 step
coef(object, m=500)

l2boost documentation built on Feb. 11, 2022, 5:10 p.m.