pen_function function

Elastic net penalty value

Elastic net penalty value

Returns the elastic net penalty value without the lambda factor.

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

Arguments

  • coefficients: The model's coefficients (excluding intercept).
  • alpha: The elasticnet mixing parameter, with 0α10 \le \alpha \le 1.
  • vp: Penalty factors for each of the coefficients.

Details

The penalty is defined as

(1α)/2vpjβj2+αvpjβ. (1-\alpha)/2 \sum vp_j \beta_j^2 + \alpha \sum vp_j |\beta|.

Note the omission of the multiplicative lambda factor.