rqss(formula, tau = 0.5, data = parent.frame(), weights, na.action,
method = "sfn", lambda = NULL, contrasts = NULL, ztol = 1e-5, control, ...)
qss
terms that represent additive
nonparametric components. These terms can be univariatna.fail
) is to create an error if any missing values are
found. A possible alternative is na.o
NULL
appearing in the model formula.
The elements of the list should have the same name as the variable
and should be either a contrast matrix (specifically, any fulsfn.control
rqss.object
for further details on this object, and references to methods
to look at it.logLik
and AIC
that is
relevant to lambda selection. A more detailed description of
some recent developments of these methods is available from
within the package with vignette("rqss")
. Since this
function uses sparse versions of the interior point algorithm
it may also prove to be useful for fitting linear models
without qss
terms when the design has a sparse
structure, as for example when there is a complicated factor
structure. If the
[2] Koenker, R., P. Ng and S. Portnoy, (1994) Quantile Smoothing Splines; Biometrika 81, 673--680.
[3] Koenker, R. and I. Mizera, (2003) Penalized Triograms: Total Variation Regularization for Bivariate Smoothing; JRSS(B) 66, 145--163.
[4] Koenker, R. and P. Ng (2003) SparseM: A Sparse Linear Algebra Package for R, J. Stat. Software.
qss
n <- 200
x <- sort(rchisq(n,4))
z <- x + rnorm(n)
y <- log(x)+ .1*(log(x))^2 + log(x)*rnorm(n)/4 + z
plot(x, y-z)
f.N <- rqss(y ~ qss(x, constraint= "N") + z)
f.I <- rqss(y ~ qss(x, constraint= "I") + z)
f.CI <- rqss(y ~ qss(x, constraint= "CI") + z)
lines(x[-1], f.N $coef[1] + f.N $coef[-(1:2)])
lines(x[-1], f.I $coef[1] + f.I $coef[-(1:2)], col="blue")
lines(x[-1], f.CI$coef[1] + f.CI$coef[-(1:2)], col="red")
## A bivariate example
data(CobarOre)
fCO <- rqss(z ~ qss(cbind(x,y), lambda= .08), data=CobarOre)
plot(fCO)
Run the code above in your browser using DataLab