coef.LarsPath | R Documentation |
Compute coefficients at a given level of penalty
## S3 method for class 'LarsPath'
coef(object, index = NULL, mode = c("lambda", "step", "fraction", "norm"), ...)
object |
a LarsParth object |
index |
If mode ="norm", index represents the l1-norm of the coefficients with which we want to predict. If mode="fraction", index represents the ratio (l1-norm of the coefficients with which we want to predict)/(l1-norm maximal of the LarsPath object). If mode="lambda", index represents the value of the penalty parameter. If mode="step", index represents the step number at which we want coefficients. |
mode |
"fraction" or "norm" or "lambda" or "step". |
... |
other arguments. Not used |
A vector containing the estimated coefficient for index
Quentin Grimonprez
HDlars
LarsPath
dataset <- simul(50, 10000, 0.4, 10, 50, matrix(c(0.1, 0.8, 0.02, 0.02), nrow = 2))
result <- HDlars(dataset$data[1:40, ], dataset$response[1:40])
coeff <- coef(result, 0.3, "fraction")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.