RSAVS_Get_Psi: Compute psi_vec

View source: R/utils.R

RSAVS_Get_PsiR Documentation

Compute psi_vec

Description

This function computes the psi_vec needed by the algorithm.

Usage

RSAVS_Get_Psi(y_vec, l_type = "L1", l_param = NULL)

Arguments

y_vec

numeric vector

l_type

character string, type of loss function.

  • "L1": l-1 loss(absolute value loss)

  • "L2": l-2 loss(squared error loss)

  • "Huber": Huber loss. Its parameter is given in l_param.

Default value is "L1".

l_param

numeric vector containing necessary parameters of the corresponding loss function. The default value is NULL.

Details

In the algorithm, when all \mu are shrinked to the same value, we have

\mu_0 = \mathrm{argmin}_{\mu} \sum_i\rho(y_i - \mu)

and

psi\_vec = (\psi(y_1 - \mu_0), \cdots, \psi(y_n - \mu_0))

where \psi = \partial \rho.

Value

the psi_vec

Note

there is a SIGN different between this psi_vec and \partial \rho w.r.t \mu

for non-differential loss like L1 at 0, the derivative at 0+ is returned.


fenguoerbian/RSAVS documentation built on Oct. 25, 2024, 3:16 p.m.