Optimizes smoothing spline and ridge regression penalties by minimizing GCV criterion. Uses BFGS optimization with analytical gradients or finite differences.
tune_Lambda(
y,
X,
X_gram,
smoothing_spline_penalty,
A,
K,
nc,
nr,
opt,
use_custom_bfgs,
C,
colnm_expansions,
wiggle_penalty,
flat_ridge_penalty,
invsoftplus_initial_wiggle,
invsoftplus_initial_flat,
unique_penalty_per_predictor,
unique_penalty_per_partition,
invsoftplus_penalty_vec,
meta_penalty,
family,
unconstrained_fit_fxn,
keep_weighted_Lambda,
iterate,
qp_score_function,
quadprog,
qp_Amat,
qp_bvec,
qp_meq,
tol,
sd_y,
delta,
constraint_value_vectors,
parallel,
parallel_eigen,
parallel_trace,
parallel_aga,
parallel_matmult,
parallel_unconstrained,
cl,
chunk_size,
num_chunks,
rem_chunks,
shared_env,
custom_penalty_mat,
order_list,
glm_weight_function,
shur_correction_function,
need_dispersion_for_estimation,
dispersion_function,
observation_weights,
homogenous_weights,
blockfit,
just_linear_without_interactions,
Vhalf,
VhalfInv,
verbose,
include_warnings,
...
)
List containing:
Lambda - Final combined penalty matrix
flat_ridge_penalty - Optimized ridge penalty
wiggle_penalty - Optimized smoothing penalty
other_penalties - Optimized predictor/partition penalties
L_predictor_list - Predictor-specific penalty matrices
L_partition_list - Partition-specific penalty matrices
List; response vectors by partition
List; design matrices by partition
List; Gram matrices by partition
Matrix; integrated squared second derivative penalty
Matrix; smoothness constraints at knots
Integer; number of interior knots in 1-D, number of partitions - 1 in higher dimensions
Integer; columns per partition
Integer; total sample size
Logical; TRUE to optimize penalties, FALSE to use initial values
Logical; TRUE for analytic gradient BFGS as natively implemented, FALSE for finite differences as implemented by stats::optim()
.
Initial penalty values
Initial grid search values (log scale)
Logical; allow predictor/partition-specific penalties
Initial values for predictor/partition penalties (log scale)
The "meta" ridge penalty, a regularization for predictor/partition penalties to pull them on log-scale towards 0 (1 on raw scale)
GLM family with optional custom tuning loss
Logical controlling GLM fitting
Quadratic programming parameters (see arguments of lgspline
)
Numeric; convergence tolerance
Response standardization parameters
List; constraint values
Logical; enable parallel computation
Parallel computation parameters
Optional custom penalty matrix
List; observation ordering by partition
Functions for GLM weights and corrections
Control dispersion estimation
Optional observation weights
Logical; TRUE if all weights equal
Logical; when TRUE, block-fitting (not per-partition fitting) approach is used, analogous to quadratic programming.
Numeric; vector of columns of input predictor matrix that correspond to non-spline effects without interactions, used for block-fitting.
Square root and inverse square root correlation structures for fitting GEEs.
Logical; print progress
Logical; print warnings/try-errors
Additional arguments passed to fitting functions
Uses BFGS optimization to minimize GCV criterion for penalty selection. Supports analytical gradients for efficiency with standard GLM families. Can optimize unique penalties per predictor/partition. Handles custom loss functions and GLM weights. Parallel computation available for large problems.
optim
for Hessian-free optimization