[R] FW: Kernel smoothing with bandwidth which varies with x

2013-05-23 Thread IOANNA
Hello all, I would like to use the Nadaraya-Watson estimator assuming a Gaussian kernel: So far I sued the library(sm) library(sm) x-runif(5000) y-rnorm(5000) plot(x,y,col='black') h1-h.select(x,y,method='aicc') lines(ksmooth(x,y,bandwidth=h1)) which works fine. What if my data were clustered

Re: [R] FW: Kernel smoothing with bandwidth which varies with x

2013-05-23 Thread Uwe Ligges
On 23.05.2013 18:10, IOANNA wrote: Hello all, I would like to use the Nadaraya-Watson estimator assuming a Gaussian kernel: So far I sued the library(sm) library(sm) x-runif(5000) y-rnorm(5000) plot(x,y,col='black') h1-h.select(x,y,method='aicc') lines(ksmooth(x,y,bandwidth=h1)) which works