[R] locpoly

Duncan Murdoch murdoch at stats.uwo.ca
Thu Feb 23 18:13:43 CET 2006


On 2/23/2006 9:56 AM, Amir Safari wrote:
>  
>    
>    Dear R Users,
>   When using locpoly function, number of output values is smaller than the number of input values. How is it possible to get number of output component $y equal to the number of inputs.

You could use linear interpolation on its outputs, e.g.

x <- runif(20)
y <- x^2 + rnorm(20)

fit <- locpoly(x, y, bandwidth=0.3)
fitfn <- approxfun(fit$x, fit$y)
yhat <- fitfn(x)

Duncan Murdoch




More information about the R-help mailing list