[R] loess

From: Jukka Nyblom <jukka.nyblom_at_jyu.fi>
Date: Thu 04 Jan 2007 - 15:39:18 GMT


Hi,

I have tried

> for (i in 1:100) L[,i] <- loess((i = =(1:100))~I(1:100), span=.5,
degree=1)$fit

to create a matrix which gives me the smoothing weights (correctly as far as I have experienced), eg.

> yhat <- loess(y~I(1:100), span=.5,degree=1)$fit
> yhat[30]

[1] -0.2131983
> L[30,]%*%y

           [,1]
[1,] -0.2131983

But, L[30,] has 56 nonzero coefficients, not 50 that I expect with span = 0.5. Actually the number of nonzero elements on rows varies being 49, 50, 55 or 56.

Does anyone know why?

Jukka Nyblom



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Fri Jan 05 08:01:42 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 05 Jan 2007 - 00:30:25 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.