Computes smoothing spline penalty matrix with optional parallel processing.
Calls get_2ndDerivPenalty
after
processing spline vs. nonspline terms and preparing for parallel if desired.
get_2ndDerivPenalty_wrapper(
K,
colnm_expansions,
C,
power1_cols,
power2_cols,
power3_cols,
power4_cols,
interaction_single_cols,
interaction_quad_cols,
triplet_cols,
nonspline_cols,
nc,
parallel,
cl
)
A \(p \times p\) penalty matrix for smoothing spline regularization containing the elementwise sum of the integrated squared second derivative of the fitted function with respect to predictors of interest.
Function is exported for reference purposes - use at your own risk!
Number of partitions (\(K+1\))
Column names of basis expansions
Basis expansion matrix of two rows, first of all maximums, second of all minimums, for all variables of interest = rbind(apply(C, 2, max)), rbind(apply(C, 2, min)))
for cubic expansions "C"
Linear term columns
Quadratic term columns
Cubic term columns
Quartic term columns
Single interaction columns
Quadratic interaction columns
Triplet interaction columns
Predictors not treated as spline effects
Number of cubic expansions
Logical to enable parallel processing
Cluster object for parallel computation