[R] Problem getting loess tricubic weights

Bert Gunter gunter.berton at gene.com
Wed Jan 9 04:59:16 CET 2013


As this does not seem to have been answered...

I believe you may misunderstand how loess works. The tricube weights
are part of the smoothing algorithm and change with each local fit,
not fixed weights for observations, which is what the "weights"
argument provides (and initially multiplies the tricube weight, IIRC).

I suggest you consult

?predict.loess

to get standard deviations of fitted values at existing or new points.

-- Bert



On Tue, Jan 8, 2013 at 12:57 AM, Joyce Lin <joycelin12 at gmail.com> wrote:
> Hi
>
> I am trying to get the tricube weights from the loess outputs as I need to
> calculate an error function which requires the weight.
>
> So I have used the following example from the R:
>
> cars.lo <- loess(dist ~ speed, cars, span=0.5, degree=1, family="symmetric")
>
> Then i try to get the weights:
>
> cars.lo$weights
>  [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
> 1 1 1 1 1 1 1 1 1 1 1 1 1 1
>
> The results are all 1 so i dont think that the tricube weighting are set.
> May I know what other parameters do i need to tweak to set the weights to
> tricube weights? Thank you.
>
>
> --
> Best regards
> Joyce Lin
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org 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.



-- 

Bert Gunter
Genentech Nonclinical Biostatistics

Internal Contact Info:
Phone: 467-7374
Website:
http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm




More information about the R-help mailing list