Learn R Programming

nnlasso (version 0.3)

predict.nnlasso: Prediction of coefficients of a penalized linear regression or generalized linear models

Description

The function computes estimated coefficients value at a given lambda or L1 norm or fraction of norm using a `nnlasso' object obtained using `nnlasso' function.

Usage

"predict"(object,mode=c("fraction","norm","lambda"),at=0,...)

Arguments

object
A `nnlasso' object obtained using `nnlasso' function.
mode
If mode="lambda", prediction is made for a given lambda, if mode="norm", prediction is made for a given L1 norm and if mode="fraction", prediction is made for a fraction of norm value. Default is mode="lambda"
at
A value at which prediction is to be made. Default is at = 0.
...
Not used. Other arguments to predict.

Value

References

Mandal, B.N. and Ma, J. (2016). L1 regularized multiplicative iterative path algorithm for non-negative generalized linear models.

Examples

Run this code
data(car)
attach(car)
x=as.matrix(car[,1:10])
g1=nnlasso(x,y1,family="binomial")
predict(g1,mode="lambda",at=0.1)
predict(g1,mode="L1norm",at=1)
predict(g1,mode="fraction",at=0.5)
g1=nnlasso(x,y,family="normal")
predict(g1,mode="lambda",at=0.09)
predict(g1,mode="L1norm",at=0.6)
predict(g1,mode="fraction",at=0.8)
detach(car)

Run the code above in your browser using DataLab