Library: | smoother |
See also: | lpregest lpregxest lpderest gasmregx |
Quantlet: | gasmregxb | |
Description: | calculates the Gasser-Mueller estimator using quartic boundary kernel |
Usage: | out = gasmregxb(data, h{, x}) | |
Input: | ||
data | n x 2 matrix containing data | |
h | scalar, bandwidth | |
x | optional m x 1 vector which indicates where to calculate the estimates, default is the first column of data | |
Output: | ||
out | m x 2 matrix containing the estimated regression function |
library("smoother") pts=100 b=0.4 randomize(12345) x=pi*((1:pts)/pts) x=x~(sin(x)+0.5*normal(pts)) x[,2]=x[,2]-2 est0=gasmregx(x,b,0,x[,1]) est1=gasmregxb(x,b,x[,1]) di=createdisplay(1,2) xp=setmask(x,"fillcircle","small") est0p=setmask(est0,"line","thin") est1p=setmask(est1,"line","thin") show(di,1,1,xp,est0p) show(di,1,2,xp,est1p)
Display showing the estimates of the regression curve with and without the boundary correction