compute_Lambda: Construct Smoothing Spline Penalty Matrix

View source: R/HelperFunctions.R

compute_LambdaR Documentation

Construct Smoothing Spline Penalty Matrix

Description

Builds the per-partition penalty \boldsymbol{\Lambda}_k = \lambda_w(\boldsymbol{\Lambda}_s + \lambda_r\boldsymbol{\Lambda}_r + \sum_{l=1}^{L}\lambda_{l,k}\boldsymbol{\Lambda}_{l,k}), together with the implementation objects used to store those pieces.

Usage

compute_Lambda(
  custom_penalty_mat,
  L1,
  wiggle_penalty,
  flat_ridge_penalty,
  K,
  p_expansions,
  unique_penalty_per_predictor,
  unique_penalty_per_partition,
  penalty_vec,
  colnm_expansions,
  just_Lambda = TRUE
)

Arguments

custom_penalty_mat

Matrix; optional custom ridge penalty structure

L1

Matrix; implementation label for the integrated squared second-derivative penalty \boldsymbol{\Lambda}_s.

wiggle_penalty, flat_ridge_penalty

Numeric; the tuning scalars \lambda_w and \lambda_r.

K

Integer; number of interior knots (K)

p_expansions

Integer; number of basis columns per partition

unique_penalty_per_predictor, unique_penalty_per_partition

Logical; enable additional \lambda_{l,k}\boldsymbol{\Lambda}_{l,k} components through predictor- or partition-specific tuning directions.

penalty_vec

Named numeric; custom values for the additional \lambda_{l,k} parameters.

colnm_expansions

Character; column names for linking penalties to predictors

just_Lambda

Logical; return only the baseline shared penalty block rather than the full list of implementation pieces.

Value

List containing Lambda, L1, L2, L_predictor_list, and L_partition_list; or just Lambda if just_Lambda = TRUE and there are no partition-specific penalties. Here L1/L2 are implementation labels for \boldsymbol{\Lambda}_s and \boldsymbol{\Lambda}_r, while the list outputs store the additional \boldsymbol{\Lambda}_{l,k} components.


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