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: regxestp lpregxest lregestp

Quantlet: lregxestp
Description: estimates a multivariate regression function using local linear kernel regression with Quartic kernel.

Reference(s):

Usage: mh = lregxestp(x {,h {,v} })
Input:
x n x (k+1), the data. The independent variables are contained in the first k columns and the dependent variable in the last one.
h optional scalar or k x 1 vector of bandwidth. If not given, 20% of the volume of x[,1:k] 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 (sorted) x.
Output:
mh n x (k+1) or m x (k+1) matrix; the first k columns contain the sorted x[,1:k], the sorted grid or the sorted v and the last column contains the regression estimate given at the values of the first k columns.

Note:

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 = lregxestp(x,2)              ; estimate function
mh = setmask(mh,"surface","blue")
plot(x,mh)                       ; surface plot
setgopt(plotdisplay,1,1,"title","ROTATE!")

Result:
The local linear 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