Description Usage Arguments Details Value
The coordinate descent to solve the LASSO (elastic net) regression problem.
It is not the standard version of the elastic net problem, so we use coordinate_descent_LASSO
.
The standard version of the elastic net problem is termed coordinate_descent_enet
.
1 2 3 4 5 6 7 8 | coordinate_descent_LASSO(
x,
y,
paras,
max.steps = 100,
condition_tol = 0.001,
loss_return = FALSE
)
|
x |
the data matrix X_{n\times p} |
y |
the response vector Y_{n \times 1} |
paras |
the combination of parameters λ_2, λ_1 |
max.steps |
maximum steps, the maximum number of steps for the updating, |
condition_tol |
the tolerance for the condition to stop, |
loss_return |
whether to return loss or not, |
The objective function of the lasso (elastic net) is
1/(2n) \| Y-Xβ\|_2^2 + λ_1\|β\|_1 + λ_2\|β\|_2^2 .
While the soft thresholding method applied to the matrix version may not lead to convergence, the updating using the soft thresholding along each coordinate can guarantee the convergence.
β the solution β or a list
a list of β, a sequence of the objective values during the CD process,
a sequence of the loss values, a sequence of the penalty values,
list(beta=beta, obj=obj, loss=loss, pen=pen)
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.