dot-compute_meta_penalty: Compute Regularization (Meta) Penalty on Penalty Parameters

.compute_meta_penaltyR Documentation

Compute Regularization (Meta) Penalty on Penalty Parameters

Description

Computes the regularization term that pulls predictor- and partition-specific penalty parameters toward 1 on the raw (positive) scale. This acts as a "meta-penalty" on the penalty magnitudes themselves.

Usage

.compute_meta_penalty(
  wiggle_penalty,
  penalty_vec,
  meta_penalty_coef,
  unique_penalty_per_predictor,
  unique_penalty_per_partition
)

Arguments

wiggle_penalty

Numeric; current wiggle penalty on raw scale.

penalty_vec

Numeric vector; current predictor/partition penalties on raw scale. May be empty (c()).

meta_penalty_coef

Numeric; coefficient for the meta-penalty.

unique_penalty_per_predictor

Logical; whether predictor-specific penalties are active.

unique_penalty_per_partition

Logical; whether partition-specific penalties are active.

Details

The penalty takes the form:

0.5 \times c_{\mathrm{meta}} \times \sum_{j} (\lambda_{j} - 1)^{2} + 0.5 \times 10^{-32} \times (\lambda_{w} - 1)^{2}

where \lambda_{j} are predictor/partition penalties and \lambda_{w} is the wiggle penalty.

Value

Numeric scalar; the regularization penalty value.


lgspline documentation built on Aug. 5, 2026, 1:10 a.m.