drqssbc: Regression Quantile Smoothing Spline with Constraints

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/drqssbc.R

Description

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

Usage

1
2
3
4
5
6
7
8
9
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

numeric vector of knots for the splines.

degree

integer, must be 1 or 2.

Tlambda

vector of smoothing parameter values λ; if it is longer than one, an “optimal” value will be selected from these.

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

integer or logical indicating the tracing level of the underlying algorithms; not much implemented (due to lack of trace in quantreg ..).

n.equal,n.smaller,n.greater,n.gradient

integers, each specifying the corresponding number of constraints.

nrq

integer, = n, the number of observations.

nl1

integer, number of observations in the l1 norm that correspond to roughness measure (may be zero).

neqc

integer giving the number of equations.

niqc

integer giving the number of inequality constraints; of the same length as constraint.

nvar

integer giving the number of equations and constraints.

nj0

integer; upper limit for the number of unique tau or lambda solutions.

tau

desired quantile level; defaults to 0.5 (median).

lam

initial λ value.

tmin

smallest value of tau to begin PLP in tau.

kmax

integer k_0, the largest effective dimension of the model allowed during PLP in lambda.

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.

Details

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

Value

a list with components ......

(use the cobs package instead!)

Author(s)

Pin Ng; this help page: Martin Maechler.

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

1
2
3
4
5
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))

cobs99 documentation built on May 31, 2017, 4:39 a.m.

Related to drqssbc in cobs99...