dot-compute_gcvu_gradient: Compute Closed-Form Gradient of GCV_u Criterion

.compute_gcvu_gradientR Documentation

Compute Closed-Form Gradient of GCV_u Criterion

Description

Computes the gradient of the modified GCV_u criterion with respect to the log-scale penalty parameters using analytical derivatives of the hat matrix trace and residual sum of squares.

Usage

.compute_gcvu_gradient(par, log_penalty_vec, outlist = NULL, env, ...)

Arguments

par

Numeric vector; log-scale penalty parameters.

log_penalty_vec

Numeric vector; log-scale predictor/partition penalties.

outlist

List or NULL; pre-computed GCV_u components from .compute_gcvu. If NULL, they are computed internally.

env

List; pre-computed objects and tuning configuration (same structure as in .compute_gcvu).

...

Additional arguments passed to fitting functions.

Details

The gradient is computed via:

\frac{\partial \mathrm{GCV}_u}{\partial \theta} = \frac{1}{D^{2}} \left( \frac{\partial N}{\partial \theta} D - N \frac{\partial D}{\partial \theta} \right)

where N = \sum r_{i}^{2} (numerator), D = n(1 - \gamma\bar{W})^{2} (denominator), \theta is the log-scale penalty parameter, and the chain rule d\lambda / d\theta = \lambda (exp parameterization) is applied.

After differentiating through \mathbf{G}, \mathbf{U}, and the trace term once, the gradient is stored as \mathbf{M}_k = \partial \mathrm{GCV}_u / \partial \boldsymbol{\Lambda}_k. Each log-penalty derivative is then \sum_k \mathrm{tr}(\mathbf{M}_k\mathbf{L}_{j,k}).

Value

List containing:

GCV_u

Numeric; GCV_u criterion value including meta-penalty.

gradient

Numeric vector; gradient on the log penalty scale.

outlist

List; GCV_u components (for reuse to avoid recomputation).


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