sqr3.fit: Cubic Spline Quantile Regression with L2-Norm Roughness...

View source: R/qfa5.0.R

sqr3.fitR Documentation

Cubic Spline Quantile Regression with L2-Norm Roughness Penalty (SQR3 or Cubic SQR)

Description

This function computes spline quantile regression with cubic splines and L2-norm roughness penalty (SQR3 or cubic SQR) from the response vector and the design matrix on a given set of quantile levels. It uses solve_osqp() in the "osqp" package or solve_piqp() in the "piqp" package. Both are general-purpose quadratic program (QP) solvers in the sparse-matrix form.

Usage

sqr3.fit(
  X,
  y,
  tau,
  tau0 = tau,
  spar = 1,
  w = rep(1, length(tau0)),
  mthreads = FALSE,
  ztol = 1e-04,
  type = c("dual", "primal"),
  solver = c("piqp", "osqp"),
  npar = c(1, 2),
  all.knots = FALSE,
  control = list()
)

Arguments

X

design matrix (requirement: nrow(X) = length(y))

y

response vector

tau

sequence of quantile levels for evaluation

tau0

sequence of quantile levels for fitting (min(tau0) <= tau <= max(tau0); default = tau)

spar

smoothing parameter (default = 1)

w

weight sequence in penalty (default = rep(1,length(tau0)))

mthreads

if FALSE (default), set RhpcBLASctl::blas_set_num_threads(1)

ztol

zero-tolerance parameter to determine the model complexity (default = 1e-04)

type

type of QP formulation: 'dual' (default) or 'primal'

solver

QP solver: 'piqp' (default) or 'osqp'

npar

experimental parameter (default = 1)

all.knots

TRUE or FALSE (default) as in stats::smooth.spline()

control

list of control parameters for the QP solver (default = list())

Value

A list with the following elements:

coefficients

matrix of regression coefficients

derivatives

matrix of derivatives of regression coefficients

crit

sequence critera for smoothing parameter select: (AIC,BIC,GIC)

np

sequence of complexity measure as the number of effective parameters

fid

sequence of fidelity measure as the quasi-likelihood

info

convergence status

nit

number of iterations

K

number of spline basis functions


qfa documentation built on March 30, 2026, 5:07 p.m.

Related to sqr3.fit in qfa...