Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

pen_function

Elastic net penalty value


Description

Returns the elastic net penalty value without the lambda factor.

Usage

pen_function(coefficients, alpha = 1, vp = 1)

Arguments

coefficients

The model's coefficients (excluding intercept).

alpha

The elasticnet mixing parameter, with 0 ≤ α ≤ 1.

vp

Penalty factors for each of the coefficients.

Details

The penalty is defined as

(1-α)/2 ∑ vp_j β_j^2 + α ∑ vp_j |β|.

Note the omission of the multiplicative lambda factor.


glmnet

Lasso and Elastic-Net Regularized Generalized Linear Models

v4.1-1
GPL-2
Authors
Jerome Friedman [aut], Trevor Hastie [aut, cre], Rob Tibshirani [aut], Balasubramanian Narasimhan [aut], Kenneth Tay [aut], Noah Simon [aut], Junyang Qian [ctb]
Initial release
2021-02-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.