dot-bf_split_components: Split Design and Penalty into Spline and Flat Components

.bf_split_componentsR Documentation

Split Design and Penalty into Spline and Flat Components

Description

Partitions the per-partition design matrices, penalty matrices, and constraint matrix into "spline" (columns receiving partition-specific coefficients) and "flat" (columns receiving a single shared coefficient across all partitions) subsets.

Usage

.bf_split_components(
  X,
  flat_cols,
  p_expansions,
  K,
  Lambda,
  L_partition_list,
  A,
  qr_pivot_smoothing_constraints = TRUE,
  parallel_qr = FALSE,
  cl = NULL,
  constraint_values
)

Arguments

X

List of K+1 design matrices (N_k \times p_expansions).

flat_cols

Integer vector of flat column indices.

p_expansions

Integer; total columns per partition.

K

Integer; number of interior knots.

Lambda

p_expansions \times p_expansions shared penalty matrix.

L_partition_list

List of partition-specific penalty matrices.

A

Full P \times R_constraints constraint matrix.

constraint_values

List of constraint right-hand sides.

Value

A named list with elements:

X_spline

List of K+1 matrices, spline columns only.

X_flat

List of K+1 matrices, flat columns only.

Lambda_spline

nc_s \times nc_s penalty submatrix.

Lambda_flat

nc_f \times nc_f penalty submatrix.

L_part_spline

List of partition-specific penalty submatrices for the spline columns.

A_spline

Spline-only constraint matrix (columns pruned and rank-reduced via pivoted QR).

nca_spline

Integer; number of columns in A_spline.

constraint_values_spline

List of constraint RHS vectors restricted to spline rows.

spline_cols

Integer vector of spline column indices.

nc_spline

Integer; number of spline columns.

nc_flat

Integer; number of flat columns.

A_flat

Flat-only constraint matrix (rows for flat coefficients, columns pruned and rank-reduced). Used to enforce mixed constraints on the flat update step.

nca_flat

Integer; number of columns in A_flat.

A_full

The original full constraint matrix A, retained for mixed-constraint enforcement.

flat_rows_all

Integer vector of flat-coefficient row indices in the full P-space.

spline_rows_all

Integer vector of spline-coefficient row indices in the full P-space.

has_mixed_constraints

Logical; TRUE if any constraint column in A has nonzero entries on both spline and flat rows.

mixed_constraint_cols

Integer vector of column indices in the original A that are mixed (touch both spline and flat rows).


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