View source: R/find_outliers.R
| find_outliers | R Documentation |
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"
)
x |
Numeric vector containing the observed weekly time series. |
dates |
A vector of class |
out.tolerance |
Numeric. Absolute t-statistic threshold used for AO inclusion.
Defaults to |
my.AO.list |
Optional vector of class |
H |
Optional matrix of holiday and trading-day regressors with
|
my.k_l |
Optional numeric vector of length two specifying the number of yearly and
monthly Fourier harmonics |
method |
Character string specifying the decomposition type. Either
|
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.
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.
#Not run:
# Searching for additive outliers in Gasoline data
data(gasoline.data)
ao_list=find_outliers(x=gasoline.data$y,dates = gasoline.data$date)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.