dot-qp_refine: Quadratic Programming Refinement for Inequality Constraints

.qp_refineR Documentation

Quadratic Programming Refinement for Inequality Constraints

Description

After the Lagrangian projection handles smoothness equality constraints, this function refines the estimate to satisfy additional inequality constraints (monotonicity, derivative sign, range bounds, or user-supplied constraints) via quadprog::solve.QP.

Usage

.qp_refine(
  result,
  X,
  y,
  K,
  p_expansions,
  A,
  Lambda,
  Lambda_block,
  family,
  iterate,
  tol,
  qp_Amat,
  qp_bvec,
  qp_meq,
  qp_score_function,
  order_list,
  glm_weight_function,
  schur_correction_function,
  need_dispersion_for_estimation,
  dispersion_function,
  observation_weights,
  VhalfInv,
  ...
)

Arguments

result

List of current coefficient column vectors by partition.

X

List of partition-specific design matrices.

y

List of response vectors by partition.

K

Integer; number of interior knots.

p_expansions

Integer; number of basis terms per partition.

A

Equality constraint matrix \mathbf{A}.

Lambda

Shared penalty matrix \boldsymbol{\Lambda}.

Lambda_block

Full block-diagonal penalty matrix.

family

GLM family object.

iterate

Logical; if TRUE, iterate the SQP loop until convergence rather than taking a single step.

tol

Convergence tolerance.

qp_Amat

Inequality constraint matrix \mathbf{C} for solve.QP.

qp_bvec

Inequality constraint vector \mathbf{c}.

qp_meq

Number of equality constraints within qp_Amat.

qp_score_function

Score function \nabla_{\boldsymbol{\beta}}\ell(\boldsymbol{\beta}^*) for the QP step.

order_list

List of index vectors mapping partition rows to original data ordering.

glm_weight_function

Function computing GLM working weights.

schur_correction_function

Function computing Schur corrections.

need_dispersion_for_estimation

Logical.

dispersion_function

Dispersion estimation function.

observation_weights

List of observation weights by partition.

VhalfInv

Inverse square root of the working correlation matrix in the original observation ordering (or NULL); permuted internally via order_list.

...

Passed to weight, correction, dispersion, and score functions.

Details

The subproblem at each iteration is a second-order Taylor approximation of the penalized log-likelihood around the current iterate \boldsymbol{\beta}^*. Collecting terms, this yields:

\tilde{\boldsymbol{\beta}} = \arg\min_{\boldsymbol{\beta}} \left\{-\mathbf{d}^{\top}\boldsymbol{\beta} + \frac{1}{2} \boldsymbol{\beta}^{\top}\mathbf{G}^{-1}\boldsymbol{\beta}\right\} \quad \text{s.t.} \quad \mathbf{A}^{\top}\boldsymbol{\beta} = \mathbf{0}, \quad \mathbf{C}^{\top}\boldsymbol{\beta} \succeq \mathbf{c}

where \mathbf{d} is the score adjusted by the current iterate and \mathbf{c} is the constraint value vector. Step acceptance uses damped updates with deviance monitoring; see Nocedal and Wright (2006) for the general SQP framework.

Value

A list with components:

result

List of refined coefficient column vectors by partition.

qp_info

List with QP solve metadata including Lagrangian multipliers and the active constraint matrix.


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