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: regest Description: computes the Nadaraya-Watson estimator for univariate regression. The computation uses WARPing.

Reference(s):
Haerdle (1990): Applied Nonparametric Regression

 Usage: mh = regest(x {,h {,K} {,d} }) Input: x n x 2, the data. In the first column the independent, in the second column the dependent variable. h scalar, bandwidth. If not given, 20% of the range of x[,1] is used. K string, kernel function on [-1,1] or Gaussian kernel "gau". If not given, the Quartic kernel "qua" is used. d scalar, discretization binwidth. d must be smaller than h. If not given, the minimum of h/3 and (max(x[,1])-min(x[,1]))/100 is used. Output: mh m x 2 matrix, the first column is a grid and the second column contains the regression estimate on that grid.

Note:
The WARPing enhances the speed of computation, but may lead to computational errors, if the bandwidth is small. For exact computation, the macro "regxest" should be used instead.

Example:
```library("smoother")
library("plot")
;
x = 4.*pi.*(uniform(200)-0.5)   ; independent variable
m = cos(x)                      ; true function
e = uniform(200)-0.5            ; error term
x = x~(m+e)
;
mh = regest(x,1)                ; estimate function
;
plot(x,mh,m)

```
Result:
```The Nadaraya-Watson regession estimate (blue) using
Quartic kernel and bandwidth h=1 and the true
regression function (thin black) are pictured.
```
Example:
```library("smoother")
library("plot")
;
mhe = regest(x,3,"epa")       ; estimate function
mhu = regest(x,2,"uni")       ; estimate function
;
```The Nadaraya-Watson regession estimates using