Learn R Programming

varycoef (version 0.3.0)

d.Lq: Derivative of \(L^q\) Norm Penalty

Description

derivative of Lq, which is not differentiable at x == 0.

Usage

d.Lq(x, lambda = 1, q = 1, d.side = "both")

Arguments

x

numeric.

lambda

non-negative scalar, shrinkage parameter.

q

non-negative scalar, norm parameter..

d.side

side of serivative at origin. Default value is "both", returning NA for x == 0. If set to "RHS", then returns RHS derivative, i.e., \(\lambda\), and \(-\lambda\) with "LHS".

Value

derivative of Lq(x), i.e., $$L^q(x) = q\lambda | x|^{q-1}$$, for x == 0 return value is NA.

Examples

Run this code
# NOT RUN {
d.Lq(-5:5)
d.Lq(-2:2, d.side = "LHS")
curve(d.Lq, from = -5, to = 5)
# }

Run the code above in your browser using DataLab