coordinate_descent_LASSO: The coordinate descent for LASSO (elastic net) regression

Description Usage Arguments Details Value

View source: R/FGSPCAUtils.R

Description

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.

Usage

1
2
3
4
5
6
7
8
coordinate_descent_LASSO(
  x,
  y,
  paras,
  max.steps = 100,
  condition_tol = 0.001,
  loss_return = FALSE
)

Arguments

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, 100 (default)

condition_tol

the tolerance for the condition to stop, 1e-3 (default)

loss_return

whether to return loss or not, FALSE (default)

Details

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.

Value

β 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).


ipapercodes/FGSPCA documentation built on Dec. 20, 2021, 7:58 p.m.