Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

predict.kqr

Predict method for kernel Quantile Regression object


Description

Prediction of test data for kernel quantile regression

Usage

## S4 method for signature 'kqr'
predict(object, newdata)

Arguments

object

an S4 object of class kqr created by the kqr function

newdata

a data frame, matrix, or kernelMatrix containing new data

Value

The value of the quantile given by the computed kqr model in a vector of length equal to the the rows of newdata.

Author(s)

Examples

# create data
x <- sort(runif(300))
y <- sin(pi*x) + rnorm(300,0,sd=exp(sin(2*pi*x)))

# first calculate the median
qrm <- kqr(x, y, tau = 0.5, C=0.15)

# predict and plot
plot(x, y)
ytest <- predict(qrm, x)
lines(x, ytest, col="blue")

# calculate 0.9 quantile
qrm <- kqr(x, y, tau = 0.9, kernel = "rbfdot",
           kpar= list(sigma=10), C=0.15)
ytest <- predict(qrm, x)
lines(x, ytest, col="red")

kernlab

Kernel-Based Machine Learning Lab

v0.9-29
GPL-2
Authors
Alexandros Karatzoglou [aut, cre], Alex Smola [aut], Kurt Hornik [aut], National ICT Australia (NICTA) [cph], Michael A. Maniscalco [ctb, cph], Choon Hui Teo [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.