Kernel regression with a numerical response vector or matrix | R Documentation |
Kernel regression (Nadaraya-Watson estimator) with a numerical response vector or matrix.
kern.reg(xnew, y, x, h = seq(0.1, 1, length = 10), type = "gauss" )
xnew |
A matrix with the new predictor variables whose compositions are to be predicted. |
y |
A numerical vector or a matrix with the response value. |
x |
A matrix with the available predictor variables. |
h |
The bandwidth value(s) to consider. |
type |
The type of kernel to use, "gauss" or "laplace". |
The Nadaraya-Watson estimator regression is applied.
The fitted values. If a single bandwidth is considered then this is a vector or a matrix, depeding on the nature of the response. If multiple bandwidth values are considered then this is a matrix, if the response is a vector, or a list, if the response is a matrix.
Michail Tsagris.
R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.
Wand M. P. and Jones M. C. (1994). Kernel smoothing. CRC press.
kernreg.tune, ice.kernreg, akern.reg, aknn.reg
y <- iris[, 1]
x <- iris[, 2:4]
est <- kern.reg(x, y, x, h = c(0.1, 0.2) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.