dot-compute_loocv_gradient: Compute Closed-Form Gradient of Exact Leave-One-Out Criterion

.compute_loocv_gradientR Documentation

Compute Closed-Form Gradient of Exact Leave-One-Out Criterion

Description

Computes the analytical gradient of the exact leave-one-out tuning criterion with respect to the log penalty parameters.

Usage

.compute_loocv_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; cached results from .compute_loocv().

env

List; tuning environment.

...

Additional arguments passed to fitting functions.

Details

The implementation below keeps the exact LOO gradient fully analytic, including the leverage derivative. In empirical diagnostics, the observation-wise leverage component can be numerically delicate even when the aggregate gradient remains informative; see the developer diagnostics in inst/diagnostics/gradient_diagnostics.R for inspection tools.

Value

List with criterion_value, gradient, and outlist.


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