Robustly smooths a time series by means of running medians.
USAGE:
smooth(x, twice=T)
REQUIRED ARGUMENTS:
x:
numeric vector, matrix, univariate or multivariate time series to be smoothed.
Time series may be regular or calendar (class "rts" or "cts")
but not irregular (class "its").
The length of each vector, column or channel must be at least four.
Missing values (NA, NaN or Inf) are not accepted.
OPTIONAL ARGUMENTS:
twice:
logical flag: if TRUE, performs twicing.
Twicing is the process of smoothing, computing the
residuals from the smooth, smoothing these and adding the
two smoothed series together.
Default is TRUE.
VALUE:
smoothed regular time series
using a method of running medians known as 4(3RSR)2H.
If twice is true, this method is applied twice.
DETAILS:
The object to be smoothed is coerced to a regular time series.
REFERENCES:
Tukey, J. W. (1977).
Exploratory Data Analysis.
Addison-Wesley, Reading, Massachusetts.
Velleman, P. F. and Hoaglin, D. C. (1981).
Applications, Basics, and Computing of Exploratory Data Analysis.
Duxbury, Boston.