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: lpregxest Description: estimates a univariate regression function using local polynomial kernel regression with Quartic kernel.

Reference(s):
Fan, J. and Gijbels, I. (1995). Data-driven bandwidth selection in local polynomial fitting: Variable bandwidth and spatial adaption. Journal of the Royal Statistical Society B, 57(2), pp. 371-394. Fan, J. and Marron, J.S. (1994). Fast implementations of nonparametric curve estimators. Journal of Computational and Graphical statistics, 3, pp. 35-56. Haerdle, W. (1991). Smoothing Techniques. With Implementations in S. Springer, New York, p. 220.

 Usage: mh = lpregxest (x,h {,p {,v}}) Input: x n x 2, the data. The first column contains the independent variable, the second one contains the dependent variable. h scalar, bandwidth. If not given, the rule of thumb bandwidth computed by lpregrot is used. p optional scalar, order of polynomial: p = 0: yields the Nadaraya-Watson estimator. p = 1: local linear (default). p = 2: local quadratic, which is the highest possible order. v optional m x 1 vector, values of the independent variable on which to compute the regression. If not given, the (sorted) x matrix is used. Output: mh n x 2 or m x 2 matrix, the first column is the sorted first column of x or the sorted v and the second column contains the regression estimate on the values of the first column.

Note:
This function does an exact computation, i.e. requires O(n^2) operations for estimating the regression function on all observations. For exploratory purposes, the quantlet "lpregest" is recommended, which uses the faster WARPing method.

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 = lpregxest(x,1)                ; estimate function
;
```The Nadaraya-Watson regression estimate (blue line) using