compute_Lambda {lgspline}R Documentation

Construct Smoothing Spline Penalty Matrix

Description

Builds penalty matrix combining smoothing spline and ridge penalties with optional predictor/partition-specific components. Handles custom penalties and scaling.

Usage

compute_Lambda(
  custom_penalty_mat,
  L1,
  wiggle_penalty,
  flat_ridge_penalty,
  K,
  nc,
  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; integrated squared second derivative penalty (\textbf{L}_1)

wiggle_penalty, flat_ridge_penalty

Numeric; smoothing and ridge penalty parameters

K

Integer; number of interior knots (K)

nc

Integer; number of basis columns per partition

unique_penalty_per_predictor, unique_penalty_per_partition

Logical; enable predictor/partition-specific penalties

penalty_vec

Named numeric; custom penalty values for predictors/partitions

colnm_expansions

Character; column names for linking penalties to predictors

just_Lambda

Logical; return only combined penalty matrix (\boldsymbol{\Lambda})

Value

List containing:

If just_Lambda=TRUE and no partition penalties, returns only Lambda matrix \boldsymbol{\Lambda}.


[Package lgspline version 0.2.0 Index]