robfilter (version 3.0)

scarm.filter: SCARM (Slope Comparing Adaptive Repeated Median)

Description

A procedure for robust online signal extraction from univariate time series by a moving window technique with adaptive window width selection based on the detection of signal changes

Usage

scarm.filter(x, right.width=30, min.left.width=right.width, 
                    min.width=right.width/3, max.width=180, 
                    sign.level=0.001, bound.noise.sd=1)

Arguments

Value

scarm.filter returns an object of class scarm.filter. An object of class scarm.filter is a list containing the following components:signala vector containing the signal extractionsadapted.widtha vector containing the adapted window widthsscarm.statistica vector containing the SCARM test statisticscritvalsa vector containing the critical values for test decisionnoise.sda vector containing the noise standard deviation estimated by a regression-free scale estimator (Gelper et al., 2009)In addition, the original input data and the input arguments used for the analysis are returned as list members. Application of the function plot to an object of class scarm.filter returns a plot showing the original time series with the filtered output.

Details

The scarm.filter works by applying Repeated Median (RM) regression (Siegel, 1982) to a moving time window with a length varying between min.width and max.width. For each point in time, the window width is adapted to the current data situation by a test which is based on the comparison of two RM slopes estimated in separated sub-windows, a right-hand and a left-hand window. The choice of the fixed width of the right-hand window right.width is crucial to distinguish between a patch of outliers and a signal change. If a patch of < k aberrant observations is to be treated as an outlier-patch, it is recommended to set right.width = 3*k. A more detailed description of the filter can be found in Borowski and Fried (2011).

References

Borowski, M., Fried, R. (2011) Robust moving window regression for online signal extraction from non-stationary time series: online window width adaption by testing for signal changes, submitted. Gelper, S., Schettlinger, K., Croux, C., and Gather, U. (2009) Robust online scale estimation in time series: A model-free approach, Journal of Statistical Planning and Inference, 139 (2), 335-349. Siegel, A.F. (1982) Robust Regression Using Repeated Medians, Biometrika 69 (1), 242-244.

See Also

robreg.filter, adore.filter, madore.filter.

Examples

Run this code
# # # # # # # # # #
# Short and noisy time series
set.seed(12)
N <- 300
noise <- rnorm(N)
signal <- c(rep(0,200),rep(10,100))
x <- signal+noise

# SCARM Filter 
signal.extr <- scarm.filter(x)

par(mfrow=c(2,1))
ts.plot(x, col="darkgrey", main="time series data and signal extraction")
lines(signal.extr$signal)
ts.plot(signal.extr$adapted.width, main="adapted window width")

Run the code above in your browser using DataLab