dot-compute_gcvu: Evaluate Modified GCV_u Criterion at a Given Penalty...

.compute_gcvuR Documentation

Evaluate Modified GCV_u Criterion at a Given Penalty Configuration

Description

Computes the modified GCV_u criterion for a given set of penalty parameters. This is the objective function minimized during penalty tuning; gcv_gamma = 1 recovers ordinary GCV.

Usage

.compute_gcvu(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:

GCV_u

Numeric; GCV_u criterion value including meta-penalty.

B

List; fitted coefficient vectors by partition.

GXX

List; \mathbf{G}_{k} \mathbf{X}_{k}^{\top}\mathbf{X}_{k} matrices.

G_list

List; eigendecomposition results from compute_G_eigen.

mean_W

Numeric; \mathrm{tr}(\mathbf{H})/N, the average leverage entering the denominator of \mathrm{GCV}_u.

sum_W

Numeric; \mathrm{tr}(\mathbf{H}), the effective degrees of freedom.

Lambda

Matrix; combined penalty matrix \boldsymbol{\Lambda}.

L1

Matrix; baseline smoothness penalty component.

L2

Matrix; baseline ridge penalty component.

L_predictor_list

List; predictor-specific penalty matrices.

L_partition_list

List; partition-specific penalty matrices.

numerator

Numeric; sum of squared residuals.

denominator

Numeric; modified-GCV denominator N(1 - \gamma\bar{W})^{2}.

residuals

List; residual vectors by partition.

denom_sq

Numeric; squared denominator.

AGAInv

Matrix; (\mathbf{A}^{\top}\mathbf{G}\mathbf{A})^{-1}.


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