Detects additive outliers (AOs) using a regression-based t-statistic search
procedure following Findley et al. (1998). The function operates on a
detrended series, where the trend is estimated using supsmu.
Optional holiday and trading-day regressors can be included. If the number of
Fourier (trigonometric) terms is not supplied via my.k_l, it is selected
automatically by minimizing AICc over a grid of yearly and monthly Fourier terms.
find_outliers(
x,
dates,
out.tolerance = 3.8,
my.AO.list = NULL,
H = NULL,
my.k_l = NULL,
method = "additive"
)A list with the following components:
Vector of class "Date" containing detected additive outlier dates,
or NULL if none are detected.
Numeric vector c(k, l) giving the number of yearly and monthly
Fourier terms used in the regression.
Numeric vector containing the observed weekly time series.
A vector of class "Date" corresponding to the observation dates.
Numeric. Absolute t-statistic threshold used for AO inclusion.
Defaults to 3.8.
Optional vector of class "Date" specifying pre-defined AO dates.
These dates are included in the regression and excluded from the forward search.
Optional matrix of holiday and trading-day regressors with
nrow(H) = length(x).
Optional numeric vector of length two specifying the number of yearly and
monthly Fourier harmonics c(k, l). If NULL, my.k_l is selected
automatically by AICc.
Character string specifying the decomposition type. Either
"additive" or "multiplicative". If "multiplicative",
the series is log-transformed prior to detrending. Defaults to "additive".
Findley, D.F., Monsell, B.C., Bell, W.R., Otto, M.C. and Chen, B.C. (1998). New capabilities and methods of the X-12-ARIMA seasonal-adjustment program. Journal of Business and Economic Statistics, 16(2), 127--152.
# \donttest{
#Not run:
# Searching for additive outliers in Gasoline data
data(gasoline.data)
ao_list=find_outliers(x=gasoline.data$y,dates = gasoline.data$date)# }
Run the code above in your browser using DataLab