robfilter (version 3.0)

wrm.filter: Weighted Repeated Median Filters for Univariate Time Series

Description

Filtering procedure based on a weighted version of Siegel's (1982) repeated median (RM) and a moving time window for robust extraction of low frequency components (the signal) in the presence of outliers and shifts. One of several weight functions can be chosen to weight the observations in each time window.

Usage

wrm.filter(y, width, weight = 1, del = floor(width/2), extrapolate = TRUE)

Arguments

Value

wrm.filter returns an object of class wrm.filter. An object of class wrm.filter is a list containing the following components:ythe original input time series.levelthe corresponding signal level extracted by the filter.slopethe corresponding slope within each time window.delthe parameter specifying the delay of the signal extraction.widthwidth of the time window.weightname of the weight function used for the fit.The function plot returns a plot showing the original time series with the filtered output.

Details

For online signal extraction without time delay, weighted repeated median filtering with triangular weights is recommendable in the presence of isolated outliers and abrupt level shifts since it reacts more quickly to shifts than unweighted repeated median filtering and provides higher efficiencies. The window width should be chosen based on a guess of the minimal time period in which the signal can be approximated by a straight line without abrupt shifts. Better results can be obtained by increasing the delay, but often minimization of the time delay itself is one of the objectives so that one prefers del=0. The procedure replaces missing values by simple extrapolations if these are not within the first time window used for initialization. For "offline" situations, it is intuitive to set del roughly equal to width/2. If the focus is rather on smoothing than on signal extraction, the Epanechnikov kernel should be used rather than the triangular kernel. In this case one can also use directly function wrm.smooth.

References

These filtering procedures are described and investigated in Fried, R., Einbeck, J., Gather, U. (2007), Weighted Repeated Median Smoothing and Filtering, Journal of the American Statistical Association 102, 1300-1308. Preliminary version available as technical report from www.sfb475.uni-dortmund.de/berichte/tr33-05.pdf

See Also

dw.filter, hybrid.filter, wrm.smooth

Examples

Run this code
data(Nile)
nile <- as.numeric(Nile)
obj <- wrm.filter(nile, width=11)
plot(obj)

Run the code above in your browser using DataLab