dot-bf_sqp_loop: Damped SQP Refinement on the Full (Optionally Whitened)...

.bf_sqp_loopR Documentation

Damped SQP Refinement on the Full (Optionally Whitened) System

Description

Runs a damped sequential quadratic programming loop using quadprog::solve.QP at each iteration, enforcing all smoothness equalities, flat-equality constraints, and any user-supplied inequality constraints.

Usage

.bf_sqp_loop(
  X_design,
  y_design,
  X_block_raw,
  beta_init,
  Lambda_block,
  qp_Amat_combined,
  qp_bvec_combined,
  qp_meq_combined,
  K,
  p_expansions,
  family,
  order_list,
  glm_weight_function,
  schur_correction_function,
  qp_score_function,
  need_dispersion_for_estimation,
  dispersion_function,
  observation_weights,
  iterate,
  tol,
  VhalfInv,
  VhalfInv_perm,
  is_gee,
  deviance_fun,
  X_partitions,
  y_partitions,
  verbose,
  ...
)

Arguments

X_design

N \times P design matrix (whitened for GEE, unwhitened otherwise).

y_design

N \times 1 response vector (whitened for GEE, unwhitened otherwise).

X_block_raw

Unwhitened block-diagonal design matrix (used for computing the linear predictor on the original scale). For the non-GEE path this equals X_design.

beta_init

P \times 1 initial coefficient vector.

Lambda_block

P \times P block-diagonal penalty.

qp_Amat_combined

Combined constraint matrix (equalities then inequalities).

qp_bvec_combined

Combined constraint RHS.

qp_meq_combined

Number of leading equality constraints.

K, p_expansions

Integers.

family

GLM family object.

order_list

Observation-index lists.

glm_weight_function, schur_correction_function

qp_score_function Functions.

need_dispersion_for_estimation

Logical.

dispersion_function

Function.

observation_weights

List or vector of weights.

iterate

Logical; if FALSE, takes at most two steps.

tol

Convergence tolerance.

VhalfInv, VhalfInv_perm

\mathbf{V}^{-1/2} matrices (original and permuted ordering). NULL for non-GEE path.

is_gee

Logical; TRUE when called from the GEE refinement path (affects deviance computation).

deviance_fun

Function computing deviance; either .bf_deviance or .bf_gee_deviance.

X_partitions

List of per-partition design matrices (unwhitened); needed for Schur correction in non-GEE path.

y_partitions

List of per-partition response vectors (unwhitened); needed for Schur correction in non-GEE path.

verbose

Logical.

...

Forwarded to weight, dispersion, and score functions.

Details

This function serves two roles within blockfit_solve:

  1. GEE Stage 2 (Case c): operates on the whitened system \tilde{\mathbf{X}} = \mathbf{V}^{-1/2} \mathbf{X}_{\mathrm{block}}, initialized from the damped Newton-Raphson backfitting warm start.

  2. Non-GEE SQP refinement: operates on the unwhitened block-diagonal design, applying inequality constraints after backfitting convergence.

Value

A named list with elements beta_block (final coefficient vector), result (per-partition coefficient list), last_qp_sol (last successful solve.QP output or NULL), converged (logical), and final_deviance (scalar).


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