predict.lars.en: Function to make predictions from lars.en fit

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

View source: R/funcs.R

Description

Function to make predictions from lars.en fit

Usage

1
2
## S3 method for class 'lars.en'
predict(object, x, lambda, ...)

Arguments

object

Result of call to lars.en

x

N by p matrix of predictors

lambda

Value of L1- regularization parameter at which predictions are desired

...

additional arguments (not used)

Details

Makes predictions from an objected returned by lars.en

Value

Vector of predicted values.

Author(s)

Rob Tibshirani

References

Hui Zou and Trevor Hastie. Regularization and Variable Selection via the Elastic Net. JRSSB (2005) 67(2) 301-320.

See Also

lars.en, covTest

Examples

1
2
3
4
5
x=matrix(rnorm(100*10),ncol=10)
x=scale(x,TRUE,TRUE)/sqrt(99)
y=4*x[,2]+rnorm(100)
a=lars.en(x,y,lambda2=1)
yhat=predict.lars.en(a,x,.5)

Example output

Loading required package: lars
Loaded lars 1.2

Loading required package: glmnet
Loading required package: Matrix
Loading required package: foreach
Loaded glmnet 2.0-12

Loading required package: glmpath
Loading required package: survival
Loading required package: MASS

covTest documentation built on May 29, 2017, 8:30 p.m.