predict: Prediction of response

Description Usage Arguments Value Author(s) Examples

Description

Predict response of a new sample Xnew at a given level of penalty

Usage

1
  predict(x, Xnew, lambda, mode = "fraction")

Arguments

x

a LarsParth object

Xnew

a matrix (of size n*x@p) of covariates.

lambda

If mode =\"norm\", lambda represents the l1-norm of the coefficients with which we want to predict. If mode=\"fraction\", lambda represents the ratio (l1-norm of the coefficientswith which we want to predict)/(l1-norm maximal of the LarsPath object).

mode

"fraction" or "norm".

Value

The predicted response

Author(s)

Quentin Grimonprez

Examples

1
2
3
dataset=MPA.simul(50,10000,0.4,10,50,matrix(c(0.1,0.8,0.02,0.02),nrow=2))
result=MPA.lars(dataset$data[1:40,],dataset$response[1:40])
y=predict(result,dataset$data[41:50,],0.3,"fraction")

MPAlars documentation built on May 2, 2019, 5:47 p.m.

Related to predict in MPAlars...