penalty: Penalty function on the composite L2, L2-Square, and L1...

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/RcppExports.R

Description

Penalty function on the composite L2, L2-Square, and L1 penalties

Usage

1
penalty(x, lambda, hierarchy, d)

Arguments

x

A vector of two numeric values, in which x_1 represents the prognostic effect, and x_2 for the predictive effect, respectively.

lambda

a vector of three penalty parameters. λ_1 and λ_2 are L2 and L2-Square (ridge) penalties for x in a group level, and λ_3 is the L1 penalty for x_2, respectively.

hierarchy

a factor value in levels 0, 1, 2, which represent different hierarchical structure in x, respectively. When hierarchy=0, λ_2 and λ_3 are forced to be zeroes; when hierarchy=1, λ_2 is forced to be zero; when hierarchy=2, there is no constraint on λ's. See smog.

d

indices for overlapped variables in x.

Value

A numeric value of the penalty function based on the composition of L2, L2-Square, and L2 penalties.

Author(s)

Chong Ma, chongma8903@gmail.com.

References

\insertRef

ma2019structuralsmog

See Also

cv.smog, smog.default, smog.formula, predict.smog, plot.smog.

Examples

1
penalty(x = rnorm(6,2,1), lambda = c(0.5,0.3,0.1), hierarchy = 0, d = c(1,1,2,2,3,3))        

smog documentation built on Aug. 10, 2020, 5:07 p.m.