Learn R Programming

qfa (version 5.0)

sqr.fit: Cubic Spline Quantile Regression with L1-Norm Roughness Penalty (SQR)

Description

This function computes spline quantile regression solution with cubic splines and L1-norm roughness penalty (SQR) from the response vector and the design matrix on a given set of quantile levels. It uses the FORTRAN code rqfnb.f in the "quantreg" package with the kind permission of Dr. R. Koenker or the R function rq.fit.sfn() in the same package as a sparse-matrix alternative. Both solve the SQR problem as a linear program (LP).

Usage

sqr.fit(
  X,
  y,
  tau,
  tau0 = tau,
  spar = 1,
  w = rep(1, length(tau0)),
  mthreads = TRUE,
  ztol = 1e-05,
  solver = c("fnb", "sfn"),
  all.knots = FALSE
)

Value

A list with the following elements:

coefficients

matrix of regression coefficients

derivatives

matrix of derivatives of regression coefficients

crit

criteria values for spar selection: (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

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, set RhpcBLASctl::blas_set_num_threads(1) (default = TRUE)

ztol

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

solver

LP solver: 'fnb' (defaut) or 'sfn'

all.knots

TRUE or FALSE (default), same as in smooth.spline()