Learn R Programming

robfilter (version 3.0)

wrm.smooth: Weighted Repeated Median Smoothing

Description

A robust smoothing tool using a kernel weighted version of Siegel's (1982) repeated median. It can be seen as an alternative to local linear L1 regression.

Usage

wrm.smooth(x, y, h, xgrid, weight = 2)

Arguments

Value

wrm.smooth returns an object of class wrm.smooth. An object of class wrm.smooth is a list containing the following components:ythe original input time series.levelthe corresponding signal level extraceted by the weighted Repeated Median filter.slopethe corresponding WRM slope within each time window.hbandwidth.xgridvector with grid values.weightname of the weight function used for the fit.The function plot returns a plot showing the original data with the smoothed output.

Details

Weighted repeated median (WRM) smoothing was suggested in a signal extraction framework by Fried, Einbeck & Gather (2007). It combines the advantages of weighted and repeated medians, i.e. the WRM smoother is robust to outliers and adapts to linear trends (through the slope parameter of the repeated median, which is calculated by applying two consecutive weighted medians onto the pairwise slopes). The theory and simulations provided by Fried, Einbeck & Gather focus on online signal extraction from time series. Warning: The case of a kernel weighted repeated median smoother for arbitraty non-equidistant design (as implemented here) is not fully investigated yet.

The procedure copes with missing values by omitting them.

References

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

Siegel, A.F. (1982). Robust regression using repeated medians. Biometrika 68, 242-244.

See Also

wrm.filter

Examples

Run this code
data(faithful) # Old Faithful Geyser data
faith.WRM <- wrm.smooth(faithful$w, faithful$e,h=4)
plot(faith.WRM)

Run the code above in your browser using DataLab