This function computes the psi_vec needed by the algorithm.
RSAVS_Get_Psi(y_vec, l_type = "L1", l_param = NULL)
numeric vector
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".
numeric vector containing necessary parameters of the corresponding loss function.
The default value is NULL
.
the psi_vec
In the algorithm, when all μ are shrinked to the same value, we have μ0=argminμ∑iρ(yi−μ) and psi_vec=(ψ(y1−μ0),⋯,ψ(yn−μ0)) where ψ=∂ρ.
there is a SIGN different between this psi_vec
and
∂ρ w.r.t μ
for non-differential loss like L1 at 0, the derivative at 0+ is returned.