Learn R Programming

cobs (version 0.9-5)

drqssbc: Regression Quantile Smoothing Spline with Constraints

Description

Estimate the B-spline coefficients for a regression quantile smoothing spline with optional constraints, using Ng(1996)'s algorithm.

Usage

drqssbc(x, y, w= rep(1,n), pw, knots, degree, Tlambda, constraint,
        n.sub = n1000cut(nrq),
        equal, smaller, greater, gradient, coef, maxiter = 20 * n,
        trace = 1,
        n.equal = nrow(equal), n.smaller = nrow(smaller),
        n.greater = nrow(greater), n.gradient = nrow(gradient),
        nrq = length(x), nl1, neqc, niqc, nvar, nj0,
        tau = 0.5, lam, tmin, kmax, lstart, factor,
        eps = .Machine$double.eps, print.warn)

Arguments

x
numeric vector, sorted increasingly, the abscissa values
y
numeric, same length as x, the observations.
w
numeric vector of weights, same length as x, as in cobs.
pw
penalty weights vector passed to l1.design or loo.design.
knots
~~Describe knots here~~
degree
integer, must be 1 or 2.
Tlambda
~~Describe Tlambda here~~
constraint
see cobs (but cannot be abbreviated here).
n.sub
integer, not larger than sample size n; the default has n.sub == n as long as n is less than 1000.
equal,smaller, greater
3-column matrices specifying the respective constraints. The has 0 zeros if there no constraints of the corresponding kind.
gradient
3-column matrix for gradient constraints.
coef
numeric vector, the initial guess for the B-spline coefficients.
maxiter
upper bound of the number of iteration; default to 20*n.
trace
~~Describe trace here~~
n.equal,n.smaller,n.greater,n.gradient
~~Describe n.gradient here~~
nrq
~~Describe nrq here~~
nl1
~~Describe nl1 here~~
neqc
integer giving the number of equations.
niqc
integer giving the number of inequality constraints.
nvar
integer giving the number of equations and constraints.
nj0
~~Describe nj0 here~~
tau
desired quantile level; defaults to 0.5 (median).
lam
~~Describe lam here~~
tmin
~~Describe tmin here~~
kmax
~~Describe kmax here~~
lstart
number, see cobs.
factor
number in [1,4], see cobs.
eps
tolerance used in the fortran code in many different contexts.
print.warn
logical indicating if warnings should be printed, when the algorithm seems to have behaved somewhat unexpectedly.

Value

  • a list with components
  • comp1Description of `comp1'
  • comp2Description of `comp2'
  • ...

Details

This is an auxiliary function for cobs, possibly interesting on its own. This documentation is currently sparse; read the source code!

References

Ng, P. (1996) An Algorithm for Quantile Smoothing Splines, Computational Statistics & Data Analysis 22, 99--118.

See Also

the main function cobs and its auxiliary qbsks which calls drqssbc() repeatedly.

Examples

Run this code
set.seed(1243)
x  <- 1:32
fx <- (x-5)*(x-15)^2*(x-21)
y  <- fx + round(rnorm(x,s = 0.25),2)
## FAILS  drqssbc(x,y,nrq=32,lam=1,degree=1,knots=c(1,5,15,32))

Run the code above in your browser using DataLab