LOWESS can be attained by the following algorithm:
(1) Execute LOESS and estimate y as yhat.
(2) Calculate residuals by e=y-yhat.
(3) Calculate the following weight:
from i=1 to n
where
@@@ for
0<=u<=1
otherwise
(4) Use r.*w and redo LOESS
(5) Repeat from (2) to (4) for certain times and get the final estimate.
In the program, we set eiterf for the number of times to repeat the processes.
LOESS and LOWESS have almost the same results on the graph:
for the same parameter. Both fit well except near zero.