| hanr_arima | R Documentation |
Fits an ARIMA model to the series and flags observations with large model residuals as anomalies.
hanr_arima(auto = "aicc", max_order = 12, cv_folds = 2, horizon = NULL)
auto |
Order selector forwarded when |
max_order |
Cap for the ACF/PACF-driven candidate lags (ARIMA++ |
cv_folds |
Number of rolling origins for the CV selection (ARIMA++ |
horizon |
CV horizon (ARIMA++ |
Fits an automatic ARIMA model via tspredit (fit_arima() when exported,
otherwise ts_arima()) and flags points whose in-sample ARIMA residual is
unusually large.
The first sw_size = max(p, d + 1, q) residuals are a warm-up window: they are
neutralised before the outlier statistics (not only masked afterwards), so a
large initialisation transient cannot inflate the threshold and hide the real
anomalies. Residual magnitudes are summarised via a distance function and
thresholded with the outlier heuristics from harutils().
hanr_arima object.
Box GEP, Jenkins GM, Reinsel GC, Ljung GM (2015). Time Series Analysis: Forecasting and Control. Wiley.
Hyndman RJ, Khandakar Y (2008). Automatic time series forecasting: the forecast package for R. Journal of Statistical Software, 27(3). doi:10.18637/jss.v027.i03
library(daltoolbox)
# Load anomaly example data
data(examples_anomalies)
# Use a simple example
dataset <- examples_anomalies$simple
head(dataset)
# Configure ARIMA anomaly detector
model <- hanr_arima()
# Fit the model
model <- fit(model, dataset$serie)
# Run detection
detection <- detect(model, dataset$serie)
# Show detected anomalies
print(detection[(detection$event),])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.