Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Library: smoother
See also: regest lpregest

Quantlet: regestp
Description: Nadaraya-Watson estimator for multivariate regression. The computation uses WARPing.


Usage: mh = regestp(x {,h {,K {,d}}})
x n x (p+1), the data. In the first p columns the independent, in the last column the dependent variable.
h scalar or p x 1 vector, bandwidth. If not given, 20% of the volume of x[,1:p] is used.
K string, kernel function on [-1,1]^p. If not given, the product Quartic kernel "qua" is used.
d scalar, discretization binwidth. d[i] must be smaller than h[i]. If not given, the minimum of h/3 and (max(x)-min(x))'/r, with r=100 for p=1, and r=(1000^(1/p)) for p>1 is used.
mh m x (p+1) matrix, the first p columns constitute a grid and the last column contains the regression estimate on that grid.


x = 4.*pi.*(uniform(400,2)-0.5)
m = sum(cos(x),2)
e = uniform(400)-0.5
x = x~(m+e)
mh = regestp(x,2)
mh = setmask(mh, "surface","blue")
m  = setmask(x[,1:2]~m,"black","cross","small")

The Nadaraya-Watson regession estimate (blue) using
Quartic kernel and bandwidth h=2 and the true
regression function (thin black crosses) are pictured.

Author: S. Klinke, M. Mueller, 19990413
(C) MD*TECH Method and Data Technologies, 05.02.2006