| kqr-class {kernlab} | R Documentation |
Class "kqr"
Description
The Kernel Quantile Regression object class
Objects from the Class
Objects can be created by calls of the form new("kqr", ...).
or by calling the kqr function
Slots
kernelf:Object of class
"kfunction"contains the kernel function usedkpar:Object of class
"list"contains the kernel parameter usedcoef:Object of class
"ANY"containing the model parametersparam:Object of class
"list"contains the cost parameter C and tau parameter usedkcall:Object of class
"list"contains the used function callterms:Object of class
"ANY"contains the terms representation of the symbolic model used (when using a formula)xmatrix:Object of class
"input"containing the data matrix usedymatrix:Object of class
"output"containing the response matrixfitted:Object of class
"output"containing the fitted valuesalpha:Object of class
"listI"containing the computes alpha valuesb:Object of class
"numeric"containing the offset of the model.scalingObject of class
"ANY"containing the scaling coefficients of the data (when casescaled = TRUEis used).error:Object of class
"numeric"containing the training errorcross:Object of class
"numeric"containing the cross validation errorn.action:Object of class
"ANY"containing the action performed in NAnclass:Inherited from class
vm, not used in kqrlev:Inherited from class
vm, not used in kqrtype:Inherited from class
vm, not used in kqr
Methods
- coef
signature(object = "kqr"): returns the coefficients (alpha) of the model- alpha
signature(object = "kqr"): returns the alpha vector (identical tocoef)- b
signature(object = "kqr"): returns the offset beta of the model.- cross
signature(object = "kqr"): returns the cross validation error- error
signature(object = "kqr"): returns the training error- fitted
signature(object = "vm"): returns the fitted values- kcall
signature(object = "kqr"): returns the call performed- kernelf
signature(object = "kqr"): returns the kernel function used- kpar
signature(object = "kqr"): returns the kernel parameter used- param
signature(object = "kqr"): returns the cost regularization parameter C and tau used- xmatrix
signature(object = "kqr"): returns the data matrix used- ymatrix
signature(object = "kqr"): returns the response matrix used- scaling
signature(object = "kqr"): returns the scaling coefficients of the data (whenscaled = TRUEis used)
Author(s)
Alexandros Karatzoglou
alexandros.karatzoglou@ci.tuwien.ac.at
See Also
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")
# print model coefficients and other information
coef(qrm)
b(qrm)
error(qrm)
kernelf(qrm)