.BG
.VE $Header: /usr3/s/current/s/.help/RCS/lowess,v 1.2 83/12/30 19:30:04 rab Exp $
.FN lowess
.TL
lowess: Scatter Plot Smoothing
.CS
lowess(x, y, f, iter, delta)
.PP
.AG x,y
vectors of data for scatter plot.
.AG f
fraction of data used for smoothing at each `x' point.  The
larger the `f' value, the smoother the fit.  Default 2/3.
.AG iter
number of iterations used in computing robust estimates.
Default 3.
.AG delta
interval size (in units corresponding to `x').  If `lowess'
estimates at two `x' values within `delta' of one another,
it fits any points between them by linear interpolation.
Default 1% of the range of `x'.
If `delta=0' all but identical `x' values are estimated independently.
.RT
plot structure containing components named `x' and `y' which
are the x,y points of the smoothed scatter plot.  Note that
`x' is a sorted version of the input `x' vector, with
duplicate points removed.
.PP
This function may be slow for large numbers of points; execution time
is proportional to (`iter*f*n^2').
Increasing `delta' should speed things up, as will decreasing `f'.
.SH REFERENCE
W. S. Cleveland,
"Robust Locally Weighted Regression and Smoothing Scatterplots",
.ul
JASA, Vol 74, No 368, pp 829-836.,
December 1979.
.EX
plot(x,y)
lines( lowess( x,y ) )   #scatter plot with smooth

fit <- lowess(x,y)
resid <- y-approx(fit,x)$y #residual from smooth
.KW basic*
.KW robust
.KW plot*
.KW smoothing
.KW dplot*
.KW regression
.WR
