Description Usage Arguments Value Examples
fits elastic net to data using coordinate descent algorithm.
1 2 | elnet_coord(x, y, a, lambda, betahat = rep(0, NCOL(x)),
maxiteration = 100)
|
x |
n*p matrix;explanatory variables |
y |
n*1 vector;response variable |
a |
a constant;the l-2 regularization coefficient |
lambda |
a constant;the l-1 and l-2 regularization coefficient |
betahat |
p*1 vector;the initial regression coefficient;default is a zero vector |
maxiteration |
maximum number of iteration allowed |
the estimated regression coefficient beta
1 2 3 | x <- matrix(rnorm(500),100,5)
y <- x%*%rep(-1,5)+rnorm(100)
elnet_coord(x,y,0.5,1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.