Compute the derivative for a nonconvex penalty.
penalty_derivative( theta = seq(-5, 5, length.out = 1e+05), penalty = "atan", lambda = 1, gamma = c(0.01, 0.05) )
theta | Numeric vector. Values for which the derivative is computed. |
---|---|
penalty | Character string. Which penalty should be
used (defaults to |
lambda | Numeric. Regularization parameter (defaults to |
gamma | Numeric vector. Hyperparameter(s) for the penalty function |
A list of class penalty_derivative
, including the following:
deriv
: Data frame including the derivative, theta, gamma,
and the chosen penalty.
lambda
: Regularization parameter.
Some care is required for specifying gamma
. For example,
the default value for scad
is 3.7 and it must be some
value greater than 2 (Fan and Li 2001)
. The
default values in GGMncv are set to recommended values in the
respective papers.
Fan J, Li R (2001). “Variable selection via nonconcave penalized likelihood and its oracle properties.” Journal of the American statistical Association, 96(456), 1348--1360.
deriv <- penalty_derivative(theta = seq(-5,5,length.out = 10000), lambda = 1, gamma = c(0.01, 0.05, 0.1)) head(deriv$deriv) #> deriv thetas gamma penalty #> 1 0.0002586469 5.000000 0.01 atan #> 2 0.0002587504 4.999000 0.01 atan #> 3 0.0002588539 4.998000 0.01 atan #> 4 0.0002589576 4.997000 0.01 atan #> 5 0.0002590612 4.996000 0.01 atan #> 6 0.0002591650 4.994999 0.01 atan