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

 Quantlet: regxestp Description: computes the Nadaraya-Watson estimator for multivariate regression.

Reference(s):
Haerdle, W. (1990). Applied Nonparametric Regression. Econometric Society Monographs, No. 19. Cambridge University Press. Wand, M. P. and Jones, M. C. (1995). Kernel Smoothing, Vol. 60 of Monographs on Statistics and Applied Probability. Chapman and Hall, London. Haerdle, W. and Mueller, M (2000). Multivariate and Semiparametric Kernel Regression, in M.G. Schimek (Ed.): Smoothing and Regression. Approaches, Computation and Application. Wiley, pp. 357-391

 Usage: mh = regxestp(x {,h {,K} {,v} }) Input: x n x (k+1) matrix, the data. In the first k columns the independent variables is contained and in the last column the dependent one. h optional scalar, k x 1 vector or 1 x k vector, bandwidth. If not given, 20% of the range of x[,1:k] is used as default. K optional string, kernel function on [-1,1] or Gaussian kernel "gau". If not given, the Quartic kernel "qua" is used as default. v optional m x k matrix, values of the independent variable in which to compute the regression. If not given and k < 4, a grid of length 100 (k = 1), length 30 (k = 2) or length 8 (k = 3) is used. If k >= 4 then v is set to the (sorted) x. Output: mh n x (k+1) or m x (k+1) matrix, the first k columns contain the grid or the sorted x[,1:k], the last column contains the regression estimate on the values of the first k columns.

Note:
This function does an exact computation, i.e., requires O(n^2) operations for estimating the regression function on all observations. For dimension > 2 this is usually faster than the WARPing method.

Example:
```library("smoother")
library("plot")
;
x = 2.*pi.*(uniform(200,2)-0.5)  ; independent variable
m = sum(cos(x),2)                ; true function
e = uniform(200)-0.5             ; error term
x = x~(m+e)
;
mh = regxestp(x,2)               ; estimate function
plot(x,mh)                       ; surface plot
setgopt(plotdisplay,1,1,"title","ROTATE!")

```
Result:
```The Nadaraya-Watson regression estimate (blue line) using
Quartic kernel and bandwidth h = 2 and the data are
pictured.
```

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