dot-bf_constrained_flat_update: Constrained Flat Update Given Current Spline Solution

.bf_constrained_flat_updateR Documentation

Constrained Flat Update Given Current Spline Solution

Description

Solves for flat coefficients subject to the residual equality constraint imposed by the full constraint system, conditional on the current spline block solution.

Usage

.bf_constrained_flat_update(
  XfWXf_pen,
  Xfr,
  A_full,
  constraint_values,
  beta_spline,
  flat_rows_all,
  spline_rows_all,
  spline_cols,
  flat_cols,
  p_expansions,
  K,
  nc_flat
)

Arguments

XfWXf_pen

Penalized flat Gram matrix (nc_f \times nc_f).

Xfr

Right-hand side cross-product for flat update (nc_f \times 1).

A_full

Full constraint matrix (P \times R).

constraint_values

List of constraint RHS vectors.

beta_spline

List of K+1 current spline coefficient vectors.

flat_rows_all

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

spline_rows_all

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

spline_cols

Integer vector of spline column indices within each partition.

flat_cols

Integer vector of flat column indices within each partition.

p_expansions

Integer; columns per partition.

K

Integer; number of interior knots.

nc_flat

Integer; number of flat columns.

Details

When the full constraint system is \mathbf{A}^\top \boldsymbol{\beta} = \mathbf{c}, and we partition \boldsymbol{\beta} into spline and flat blocks, the flat update must satisfy:

\mathbf{A}_{\mathrm{flat}}^\top \boldsymbol{\beta}_{\mathrm{flat}} = \mathbf{c} - \mathbf{A}_{\mathrm{spline}}^\top \boldsymbol{\beta}_{\mathrm{spline}}

This function solves the penalized least-squares problem for flat coefficients subject to this residual equality constraint using a Lagrangian approach.

Value

Numeric vector of flat coefficients (nc_f \times 1).


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