dot-compute_loocv: Evaluate Exact Leave-One-Out Criterion at a Given Penalty...

.compute_loocvR Documentation

Evaluate Exact Leave-One-Out Criterion at a Given Penalty Configuration

Description

Computes the exact leave-one-out tuning criterion for the same transformed linearized problem used elsewhere in the tuning machinery.

Usage

.compute_loocv(par, log_penalty_vec, env, ...)

Arguments

par

Numeric vector; log-scale penalty parameters. First two elements are log(wiggle_penalty) and log(flat_ridge_penalty). Remaining elements (if any) are log-scale predictor/partition penalties.

log_penalty_vec

Numeric vector; log-scale predictor/partition penalties (passed separately for compatibility with the grid search).

env

List; pre-computed objects and tuning configuration. Contains:

X, y, X_gram, Xy

Design matrices, response, Gram matrices, cross-products.

A, R_constraints, K, p_expansions, N_obs

Constraint matrix and dimensions.

smoothing_spline_penalty

Integrated second-derivative penalty matrix.

custom_penalty_mat

Optional custom penalty matrix.

colnm_expansions

Character vector of expansion column names.

unique_penalty_per_predictor, unique_penalty_per_partition

Logicals.

family

GLM family object.

delta

Pseudocount for link function stabilization.

gcv_gamma

Modified-GCV inflation factor applied to the effective-degrees-of-freedom term in the denominator.

meta_penalty

Meta-penalty coefficient.

order_list

List of observation indices per partition.

observation_weights, homogenous_weights

Observation weighting.

parallel flags, cl, chunk_size, num_chunks, rem_chunks

Parallel config.

unconstrained_fit_fxn, keep_weighted_Lambda, iterate

Fitting config.

qp_score_function, quadprog, qp_Amat, qp_bvec, qp_meq

QP config.

tol, sd_y

Convergence tolerance and response scale.

constraint_value_vectors

Constraint values.

glm_weight_function, schur_correction_function

GLM functions.

need_dispersion_for_estimation, dispersion_function

Dispersion.

blockfit, just_linear_without_interactions

Blockfit config.

use_blockfit

Logical; pre-computed dispatch flag for blockfit.

flat_cols

Integer vector; pre-computed flat column indices.

Vhalf, VhalfInv

Correlation structure matrices.

verbose, include_warnings

Output control.

...

Additional arguments passed to fitting functions.

Value

List containing the fitted objects plus criterion_value, LOO_u, h_diag, and C_list.


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