scarm.filter | R Documentation |
A procedure for robust online signal extraction from univariate time series ("smoothing") by a moving window technique with adaptive window width selection based on Repeated Median regression
scarm.filter(time.series,
right.width=30, min.left.width=right.width,
min.width=floor(right.width/3), max.width=200,
sign.level=0.001, bound.noise.sd=0.01, rtr=TRUE,
autocorrelations="automatic")
time.series |
a numeric vector or (univariate) time series object. |
right.width |
a positive integer >=5 defining the fixed width of the right-hand window used for testing; the choice of |
min.left.width |
a positive integer |
min.width |
a positive integer |
max.width |
a positive integer |
sign.level |
significance level of the test procedure; must be a value in |
bound.noise.sd |
a lower bound for the estimate of the noise standard deviation; this bound ensures that the noise scale estimate cannot be zero due to ties in the data; must be a value |
rtr |
if |
autocorrelations |
the |
The scarm.filter
fits a Repeated Median (RM, Siegel, 1982) regression line to a moving window sample with length varying between min.width
and max.width
.
For each time point, the window width is adapted to the current data situation by a test comparing two RM slopes estimated in separated sub-windows, a right-hand and a left-hand window.
A more detailed description of the filter can be found in Borowski and Fried (2011).
scarm.filter
returns an object of class scarm.filter
.
An object of class scarm.filter
is a list containing the
following components:
signal.est |
a vector containing the signal estimations |
slope.est |
a vector containing the slope (or trend) estimations |
adapted.width |
a vector containing the adapted window widths |
test.statistic |
a vector containing the SCARM test statistics |
critvals |
a vector containing the critical values for test decision |
noise.sd |
a vector containing the estimates of the noise standard deviation |
slope.diff |
a vector containing the differences of the Repeated Median slopes estimated in the left-hand and right-hand window |
acf.lag.one |
a vector containing the estimated autocorrelations at lag one for each time point; estimation is done on the recent |
time.series |
the original input data |
In addition, 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. If info==TRUE
(default), a plot of the adapted window widths is also given.
Matthias Borowski
Borowski, M. and Fried, R. (2011)
Robust repeated median regression in moving windows with data-adaptive width selection, Discussion Paper 28/2011, SFB 823, TU Dortmund University.
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.
robreg.filter
, adore.filter
, madore.filter
, mscarm.filter
.
# Time series
data(multi.ts)
x <- multi.ts[,1]
# apply SCARM Filter
scarm.extr <- scarm.filter(x)
plot(scarm.extr)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.