Scatter Plot Smoothing Using Super Smoother

DESCRIPTION:
Returns a list containing x and y components that are a smooth of the input data. This algorithm is designed to be fast, and by default uses cross validation to pick the span.

USAGE:
supsmu(x, y, wt=rep(1,length(y)), span="cv", periodic=F, bass=0)

REQUIRED ARGUMENTS:
x:
vector of abscissa values for the scatter plot. Missing values are allowed.
y:
vector of ordinate values for the scatter plot. Missing values are allowed.

OPTIONAL ARGUMENTS:
wt:
vector of weights for each (x,y) observation. Missing values are allowed.
span:
fraction of observations in the smoothing window. If span="cv", then automatic (variable) span selection is done by means of cross validation.
periodic:
if TRUE, the smoother assumes x is a periodic variable with values in the range [0.0, 1.0] and period 1.0. An error occurs if x has values outside this range.
bass:
control of the low frequency emphasis when using cross validation. The larger the value of bass (up to 10), the smoother the fit from automatic span selection. Values of bass less than 0 or greater than 10 are essentially the same as 0.

VALUE:
a list with the following components:
x:
the sorted input x vector with duplicate points removed.
y:
the smoothed y vector corresponding to the output x.

SIDE EFFECTS:
a warning is issued if there were NAs and/or Infs in the input x, y or wt. Such observations are dropped from the computations.

BACKGROUND:
The supsmu function serves a purpose similar to that of the function lowess. supsmu is much faster although it does not have the robustness properties of lowess. For small samples (n<40), or if there are substantial serial correlations between observations close in x-value, a prespecified fixed span smoother (span > 0) should be used. Reasonable span values are from 0.3 to 0.5.

REFERENCES:
Friedman, J. H. (1984). A Variable Span Smoother. Tech. Rep. No. 5, Laboratory for Computational Statistics, Dept. of Statistics, Stanford Univ., California.

The chapter "Regression and Smoothing for Continous Response Data" in the S-PLUS Guide to Statistical and Mathematical Analysis.


SEE ALSO:
lowess .

EXAMPLES:
plot(lottery.number, lottery.payoff, main="supsmu example")
fit <- supsmu(lottery.number, lottery.payoff)
lines(fit)  # draw the smooth on the scatter plot
residuals <- lottery.payoff-approx(fit, lottery.number)$y
plot(lottery.number, residuals) # residuals from smooth