double.window(y, outer.n, inner.n, d = 2, scale = "MAD",
mad.corr.file = NULL, methods = "all", plot = FALSE,
plot.methods = methods, online = FALSE)double.window.online(...)
outer.n.d = 2 meaning a $2\sigma$ rule.methods parameter may be named.The MAD is the classical highly robust choice for the estimation of the variance. The SN is a somewhat more efficient and almost equally robust alternative, while the QN is much more efficient in case of not very small window widths and performs very well at the occurrence of shifts.
The inner window width should be chosen at least twice the length of outlier patches in the series to be ignored in case of the location based, and at least three times this length in case of the regression based methods. Otherwise the methods can be severely influenced by outlier patches. The outer window width can then be chosen rather large to increase the efficiency of the final estimate, provided that it is smaller than the time in between subsequent level shifts.
The factor d with which the scale is multiplied for fixing the trimming boundaries can be chosen similar to classical rules for detecting unusual observations in a Gaussian sample. Choosing d=3 instead of d=2 increases efficiency, but decreases robustness; d=2.5 might be seen as a compromise.
hybriddata(serie1t)
double.window(serie1t$y,
outer.n=25, inner.n=15,
d=2.5, scale="QN",
methods = c("RM", "TRM"))Run the code above in your browser using DataLab