coef.plasso | R Documentation |
plasso
objectExtract coefficients for both Lasso and Post-Lasso from a plasso
object.
## S3 method for class 'plasso'
coef(object, ..., s = NULL)
object |
|
... |
Pass generic |
s |
If Null, coefficients are returned for all lambda values. If a value is provided, the closest lambda value of the |
List object containing coefficients that are associated with either all values along the lambda input sequence or for one specifically given lambda value for both the Lasso and Post-Lasso models respectively.
lasso |
Sparse |
plasso |
Sparse |
# load toeplitz data
data(toeplitz)
# extract target and features from data
y = as.matrix(toeplitz[,1])
X = toeplitz[,-1]
# fit plasso to the data
p = plasso::plasso(X,y)
# get estimated coefficients along whole lambda sequence
coefs = coef(p)
head(coefs$plasso)
# get estimated coefficients for specific lambda approximation
coef(p, s=0.05)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.