dot-compute_meta_penalty_gradient: Compute Gradient of Regularization (Meta) Penalty

.compute_meta_penalty_gradientR Documentation

Compute Gradient of Regularization (Meta) Penalty

Description

Computes the gradient of the meta-penalty with respect to the log-scale penalty parameters, incorporating the exp parameterization chain rule.

Usage

.compute_meta_penalty_gradient(
  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

Under exp parameterization \lambda = \exp(\theta):

\frac{\partial}{\partial \theta} \left[ 0.5 c (\exp(\theta) - 1)^{2} \right] = c (\lambda - 1) \lambda

Value

Numeric vector; gradient of the meta-penalty on the log scale. Length equals 2 + length(penalty_vec).


lgspline documentation built on May 8, 2026, 5:07 p.m.