madore.filter: A multivariate adaptive online repeated median filter

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/madore.filter.R


Procedure for robust signal extraction from a multivariate time series by a moving window technique with adaptive window width selection (multivariate adaptive online repeated median filter). The window width adaption is based on the univariate adore.filter.


madore.filter(Y, byrow=FALSE,
              min.width=10, max.width=200,
              rtr.size=min.width, sign.level=0.1,
              NA.sample.size=min.width, minNonNAs=min.width/2)



a numeric matrix or (multivariate) time series object.


logical. If FALSE (the default), the filtering is done by columns, otherwise the filtering is done by rows.


a positive integer ≥ 10 specifying the minimal width of the moving time window.


a positive integer min.width specifying the maximal width of the moving time window. If min.width = max.width, the window width is fixed.


a positive integer in [5, min.width] defining a test window of the rightmost test.sample.size time points within the current time window. The Repeated Median (RM) regression residuals within the test window are used for a goodness of fit test (see adore.filter) for finding an adequate window width. For more details about the test, see Schettlinger, Fried, Gather (2010).

a character string defining the search algorithm used for finding an adequate window width at each point in time.


The linear search always results in the largest window width possible and hence yields the smoothest online signal. However, if sudden changes (like level shifts) appear in the signal it requires a lot of computation time and thus, an increased variability of the extracted signal may be observed.


The binary search is recommended if it can be expected that the window width needs to be reduced drastically from a large to a very small value at certain times (for example at level shifts or trend changes). However, it may not always result in the largest possible window width.

"geometric" (default)

The geometric search is as fast as the binary search but it puts more weight on large window widths. It offers a good compromise between the linear and the binary search (computation time vs. smooth output signal).


a non-negative integer specifying the size of a subset of the most recent observations within each window. The signal estimation is restricted to the range of the observations within this subset.


the level of significance for the goodness of fit test (see adore.filter) for finding an adequate window width. For more details about the test, see Schettlinger, Fried, Gather (2010).


a positive integer in [10, min.width] specifying the size of a subset of the most recent observations within each window. See minNonNAs.


a positive integer in [5, NA.sample.size]. If a variable does not offer at least minNonNAs non-missing observations within the subset specified by NA.sample.size, the signal is not estimated for this variable at this time point t.


The madore.filter is based on Repeated Median regression (Siegel, 1982) in moving time windows and serves for separating signals from noise and outliers in multivariate time series. At each time point t the test procedure of the adaptive online Repeated Median filter (Schettlinger, Fried, Gather, 2010) is used to determine an appropriate window width n(t) in [min.width, max.width]. Then the signal vector at time t is estimated within the time window (t-n(t)+1,…,t) by a slight modification of the multivariate Trimmed Repeated Median-Least Squares regression (Lanius, Gather, 2010). A more detailed description of the madore.filter can be found in Borowski, Schettlinger, Gather (2009).


madore.filter returns an object of class madore.filter. An object of class madore.filter is a list containing the following components:


a matrix containing the estimated signal vectors at each time point t.


a matrix containing the individual window widths of each variable at each time point t.


a vector containing the overall window widths at each time point t.

In addition, the original input data is returned as list member Y, and the settings used for the analysis are returned as the list members byrow, min.width, max.width, start.width, test.sample.size,, rtr.size, extr.delay, NA.sample.size, and minNonNAs. Application of the function plot to an object of class madore.filter returns a plot showing the original multivariate time series with the filtered output.


Matthias Borowski


Borowski, M., Schettlinger, K., Gather, U. (2009) Multivariate Real Time Signal Extraction by a Robust Adaptive Regression Filter, Communications in Statistics - Simulation and Computation 38, 426-440.

Lanius, V., Gather, U. (2010) Robust Online Signal Extraction from Multivariate Time Series, Computational Statistics and Data Analysis 54(4), 966-975.

Schettlinger, K., Fried, R., Gather, U. (2010) Real Time Signal Processing by Adaptive Repeated Median Filters, International Journal of Adaptive Control and Signal Processing 24(5), 346-362.

Siegel, A.F. (1982) Robust Regression Using Repeated Medians, Biometrika 69(1), 242-244.

See Also

robreg.filter, adore.filter, scarm.filter, mscarm.filter.


## Not run: 
extr <- madore.filter(multi.ts)

## End(Not run)   

robfilter documentation built on Nov. 21, 2019, 5:07 p.m.