model and produces forecasts that incorporate the effects of outliers whose effects persist beyond the end of the series.
. This can contain outliers and missing observations. Outliers are identified by this routine and missing values are identified by the time values in tpoints. If the time interval between two consecutive time points is greater than one, i.e., ti+1 – ti = m > 1, then m – 1 missing values are assumed to exist between ti and ti+1 at times ti + 1, ti + 2, ..., ti+1 – 1. Therefore, the gap free series is assumed to be defined for equidistant time points t1, ti + 1, ..., tn_obs. Missing values are automatically estimated prior to identifying outliers and producing forecasts. Forecasts are generated for both missing and observed values.
model. Upon completion, if d = model(3) = 0, then an ARMA(p, q) model or AR(p) model is fitted to the outlier-free version of the observed series
. If d = model(3) > 0, these parameters are computed for an ARMA(p, q) representation of the seasonally adjusted series
, where
and s = model(2) ≥ 1.
selection.
model (Model keyword required.)
, the estimates of the white noise in the outlier free original series.
, plus estimated values for any time gaps. The second column contains the same values as the first column adjusted by removing any outlier effects. In effect, the second column contains estimates of the underlying outlier-free series, Yt. If no outliers are detected then both columns will contain identical values.
model, and then uses the fitted model to identify outliers and prepare forecasts. The order of this model can be specified or automatically determined. The ARIMA
model handled by AUTO_ARIMA has the following form:
model and the removed outliers, forecasts are then prepared for the outlier-free series. Outlier effects are added to these forecasts to produce a forecast for the observed series,
. If there are no outliers, then the forecasts for the outlier-free series and the observed series will be identical.
Selection
representation of the series. Here, every possible combination of values for p, s in S_initial and d in D_initial is examined. The best found ARIMA
representation is then used as input for the outlier detection routine.
Modelnote | Providing S_initial without D_initial causes a default value of 0 to be used for D_initial. In this case, no differencing is performed on the original time series. |
Outlier Identifier | Name | General Description |
|---|---|---|
0 | (IO) Innovational Outlier | Innovational outliers persist. Meaning, there is an initial impact at the time the outlier occurs. This effect continues in a lagged fashion with all future observations. The lag coefficients are determined by the coefficient of the underlying ARIMA model. |
1 | (AO) Additive Outlier | Additive outliers do not persist. As the name implies, an additive outlier effects only the observation at the time the outlier occurs. Hence additive outliers have no effect on future forecasts. |
2 | (LS) Level Shift | Level shift outliers persist. They have the effect of either raising or lowering the mean of the series starting at the time the outlier occurs. This shift in the mean is abrupt and permanent. |
3 | (TC) Temporary Change | Temporary change outliers persist and are similar to level shift outliers with one major exception. Like level shift outliers, there is an abrupt change in the mean of the series at the time this outlier occurs. However, unlike level shift outliers, this shift is not permanent. The TC outlier gradually decays, eventually bringing the mean of the series back to its original value. The rate of this decay is modeled using the parameter Delta. The default of Delta = 0.7 is the value recommended for general use by Chen and Liu (1993). |
4 | (UI) Unable to Identify | If an outlier is identified as the last observation, then the algorithm is unable to determine the outlier’s classification. For forecasting, a UI outlier is treated as an IO outlier. That is, its effect is lagged into the forecasts. |
model = INTARR(4)
x = [12.8, 12.2, 11.9, 10.9, 10.6, 11.3, 11.1, 10.4, 10.0, $
9.7, 9.7, 9.7, 11.1, 10.5, 10.3, 9.8, 9.8, 10.4, $
10.4, 10.0, 9.7, 9.3, 9.6, 9.7, 10.8, 10.7, 10.3, $
9.7, 9.5, 10.0, 10.0, 9.3, 9.0, 8.8, 8.9, 9.2, $
10.4, 10.0, 9.6, 9.0, 8.5, 9.2, 9.0, 8.6, 8.3, $
7.9, 8.0, 8.2, 9.3, 8.9, 8.9, 7.7, 7.6, 8.4, $
8.5, 7.8, 7.6, 7.3, 7.2, 7.3, 8.5, 8.2, 7.9, $
7.4, 7.1, 7.9, 7.7, 7.2, 7.0, 6.7, 6.8, 6.9, $
7.8, 7.6, 7.4, 6.6, 6.8, 7.2, 7.2, 7.0, 6.6, $
6.3, 6.8, 6.7, 8.1, 7.9, 7.6, 7.1, 7.2, 8.2, $
8.1, 8.1, 8.2, 8.7, 9.0, 9.3, 10.5, 10.1, 9.9, $
9.4, 9.2, 9.8, 9.9, 9.5, 9.0, 9.0, 9.4, 9.6, $
11.0, 10.8, 10.4, 9.8, 9.7, 10.6, 10.5, 10.0, 9.8, $
9.5, 9.7, 9.6, 10.9, 10.3, 10.4, 9.3, 9.3, 9.8, $
9.8, 9.3, 8.9, 9.1, 9.1, 9.1, 10.2, 9.9, 9.4, $
8.7, 8.6, 9.3, 9.1, 8.8, 8.5]
times = INDGEN(141) + 1
n_predict = 6
n_obs = 135
x_tmp = x(0:n_obs-1)
times_tmp = times(0:n_obs-1)
parameters = AUTO_ARIMA(times_tmp, x_tmp, $
Model=model, $
Aic=aic, $
Maxlag=5, $
Critical=4.0, $
Num_Outliers=num_outliers, $
Outlier_Statistics=outlier_stat, $
Res_Sigma=res_sigma, $
Num_Predict=n_predict, $
Outlier_Forecast=outlier_forecast)
PRINT, $
"Method 1: Automatic ARIMA model selection, no differencing"
PRINT, ''
PRINT, model(0), model(1), model(2), model(3), $
Format='("Model chosen: ", "p=", I1, ", q=", I1, ", ' + $'s=", I1, ", d=", I1)'
PRINT, ''
PRINT, num_outliers, Format="('Number of outliers: ', I1)"PRINT, ''
PRINT, "Outlier statistics:"
PRINT, ''
PRINT, "Time point Outlier type"
FOR i=0L, num_outliers-1 DO $
PRINT, outlier_stat(i,0), outlier_stat(i,1), $
Format="(I6, 10X, I3)"
PRINT, ''
PRINT, res_sigma, Format="('RSE: ', F11.6)"PRINT, aic, Format="('AIC: ', F11.6)"PRINT, ''
p = model(0) + model(1)
PRINT, "Parameters:"
PRINT, parameters(0:(p)), Format='(F11.6)'
PRINT, ''
PRINT, " ** Forecast Table **"
PRINT, "Orig. Series Forecast Prob. Limits PSI Weights"
FOR i=0L, n_predict-1 DO $
PRINT, x(n_obs+i), outlier_forecast(i,0), $
outlier_forecast(i,1), outlier_forecast(i,2), $
Format='(F10.4, 3F13.4)'
Method 1: Automatic ARIMA model selection, no differencing
Model chosen: p=5, q=0, s=1, d=0
Number of outliers: 2
Outlier statistics:
Time point Outlier type
97 0
109 0
RSE: 0.428036
AIC: 418.118958
Parameters:
0.166740
0.857958
-0.048228
-0.239798
0.200457
0.211682
** Forecast Table **
Orig. Series Forecast Prob. Limits PSI Weights
8.7000 9.0586 0.8389 0.8580
8.6000 9.0823 1.1054 0.6879
9.3000 9.4116 1.2470 0.3090
9.1000 9.6112 1.2736 0.2266
8.8000 9.5866 1.2877 0.3983
8.5000 9.4094 1.3304 0.5762
model = INTARR(4)
s_initial = [1, 2]
d_initial = [0, 1, 2]
p_initial = [0, 1, 2, 3]
q_initial = [0, 1, 2, 3]
x = [12.8, 12.2, 11.9, 10.9, 10.6, 11.3, 11.1, 10.4, 10.0, $
9.7, 9.7, 9.7, 11.1, 10.5, 10.3, 9.8, 9.8, 10.4, $
10.4, 10.0, 9.7, 9.3, 9.6, 9.7, 10.8, 10.7, 10.3, $
9.7, 9.5, 10.0, 10.0, 9.3, 9.0, 8.8, 8.9, 9.2, $
10.4, 10.0, 9.6, 9.0, 8.5, 9.2, 9.0, 8.6, 8.3, $
7.9, 8.0, 8.2, 9.3, 8.9, 8.9, 7.7, 7.6, 8.4, $
8.5, 7.8, 7.6, 7.3, 7.2, 7.3, 8.5, 8.2, 7.9, $
7.4, 7.1, 7.9, 7.7, 7.2, 7.0, 6.7, 6.8, 6.9, $
7.8, 7.6, 7.4, 6.6, 6.8, 7.2, 7.2, 7.0, 6.6, $
6.3, 6.8, 6.7, 8.1, 7.9, 7.6, 7.1, 7.2, 8.2, $
8.1, 8.1, 8.2, 8.7, 9.0, 9.3, 10.5, 10.1, 9.9, $
9.4, 9.2, 9.8, 9.9, 9.5, 9.0, 9.0, 9.4, 9.6, $
11.0, 10.8, 10.4, 9.8, 9.7, 10.6, 10.5, 10.0, 9.8, $
9.5, 9.7, 9.6, 10.9, 10.3, 10.4, 9.3, 9.3, 9.8, $
9.8, 9.3, 8.9, 9.1, 9.1, 9.1, 10.2, 9.9, 9.4, $
8.7, 8.6, 9.3, 9.1, 8.8, 8.5]
times = INDGEN(141) + 1
n_predict = 6
n_obs = 135
x_tmp = x(0:n_obs-1)
times_tmp= times(0:n_obs-1)
parameters = AUTO_ARIMA(times_tmp, x_tmp, $
Model=model, $
Aic=aic, $
Maxlag=5, $
Critical=4.0, $
Method=2, $
P_Initial=p_initial, $
Q_Initial=q_initial, $
S_Initial=s_initial, $
D_Initial=d_initial, $
Num_Outliers=num_outliers, $
Outlier_Statistics=outlier_stat, $
Res_Sigma=res_sigma, $
Num_Predict=n_predict, $
Outlier_Forecast= $
outlier_forecast_user)
PRINT, "Method 2: Grid search, differencing allowed"
PRINT, ''
PRINT, model(0), model(1), model(2), model(3), $
Format='("Model chosen: ", "p=", I1, ", q=", I1, ", ' + $'s=", I1, ", d=", I1)'
PRINT, ''
PRINT, num_outliers, Format="('Number of outliers: ', I1)"PRINT, ''
PRINT, "Outlier statistics:"
PRINT, ''
PRINT, "Time point Outlier type"
FOR i=0L, num_outliers-1 DO $
PRINT, outlier_stat(i,0), outlier_stat(i,1), $
Format="(I6, 10X, I3)"
PRINT, ''
PRINT, res_sigma, Format="('RSE: ', F11.6)"PRINT, aic, Format="('AIC: ', F11.6)"PRINT, ''
p = model(0) + model(1)
PRINT, "Parameters:"
PRINT, parameters(0:(p)), Format='(F11.6)'
PRINT, ''
PRINT, " ** Forecast Table **"
PRINT, "Orig. Series Forecast Prob. Limits PSI Weights"
FOR i=0L, n_predict-1 DO $
PRINT, x(n_obs+i), outlier_forecast_user(i,0), $
outlier_forecast_user(i,1), outlier_forecast_user(i,2), $
Format='(F10.4, 3F13.4)'
Method 2: Grid search, differencing allowed
Model chosen: p=3, q=2, s=1, d=0
Number of outliers: 1
Outlier statistics:
Time point Outlier type
109 0
RSE: 0.412409
AIC: 408.076813
Parameters:
0.509478
1.944665
-1.901104
0.901657
1.113017
-0.914998
** Forecast Table **
Orig. Series Forecast Prob. Limits PSI Weights
8.7000 9.1109 0.8083 0.8316
8.6000 9.1811 1.0513 0.6312
9.3000 9.5185 1.1686 0.5480
9.1000 9.7804 1.2497 0.6157
8.8000 9.7117 1.3451 0.7245
8.5000 9.3842 1.4671 0.7326
model = [3, 2, 1, 0]
x = [12.8, 12.2, 11.9, 10.9, 10.6, 11.3, 11.1, 10.4, 10.0, $
9.7, 9.7, 9.7, 11.1, 10.5, 10.3, 9.8, 9.8, 10.4, $
10.4, 10.0, 9.7, 9.3, 9.6, 9.7, 10.8, 10.7, 10.3, $
9.7, 9.5, 10.0, 10.0, 9.3, 9.0, 8.8, 8.9, 9.2, $
10.4, 10.0, 9.6, 9.0, 8.5, 9.2, 9.0, 8.6, 8.3, $
7.9, 8.0, 8.2, 9.3, 8.9, 8.9, 7.7, 7.6, 8.4, $
8.5, 7.8, 7.6, 7.3, 7.2, 7.3, 8.5, 8.2, 7.9, $
7.4, 7.1, 7.9, 7.7, 7.2, 7.0, 6.7, 6.8, 6.9, $
7.8, 7.6, 7.4, 6.6, 6.8, 7.2, 7.2, 7.0, 6.6, $
6.3, 6.8, 6.7, 8.1, 7.9, 7.6, 7.1, 7.2, 8.2, $
8.1, 8.1, 8.2, 8.7, 9.0, 9.3, 10.5, 10.1, 9.9, $
9.4, 9.2, 9.8, 9.9, 9.5, 9.0, 9.0, 9.4, 9.6, $
11.0, 10.8, 10.4, 9.8, 9.7, 10.6, 10.5, 10.0, 9.8, $
9.5, 9.7, 9.6, 10.9, 10.3, 10.4, 9.3, 9.3, 9.8, $
9.8, 9.3, 8.9, 9.1, 9.1, 9.1, 10.2, 9.9, 9.4, $
8.7, 8.6, 9.3, 9.1, 8.8, 8.5]
times = INDGEN(141) + 1
n_predict = 6
n_obs = 135
x_tmp = x(0:n_obs-1)
times_tmp= times(0:n_obs-1)
parameters = AUTO_ARIMA(times_tmp, x_tmp, $
Model=model, $
Aic=aic, $
Maxlag=5, $
Critical=4.0, $
Method=3, $
Num_Outliers=num_outliers, $
Outlier_Statistics=outlier_stat, $
Res_Sigma=res_sigma, $
Num_Predict=n_predict, $
Outlier_Forecast= $
outlier_forecast)
PRINT, "Method 3: Specified ARIMA model"
PRINT, ''
PRINT, model(0), model(1), model(2), model(3), $
Format='("Model chosen: ", "p=", I1, ", q=", I1, ", ' + $'s=", I1, ", d=", I1)'
PRINT, ''
PRINT, num_outliers, Format="('Number of outliers: ', I1)"PRINT, ''
PRINT, "Outlier statistics:"
PRINT, ''
PRINT, "Time point Outlier type"
FOR i=0L, num_outliers-1 DO $
PRINT, outlier_stat(i,0), outlier_stat(i,1), $
Format="(I6, 10X, I3)"
PRINT, ''
PRINT, res_sigma, Format="('RSE: ', F11.6)"PRINT, aic, Format="('AIC: ', F11.6)"PRINT, ''
p = model(0) + model(1)
PRINT, "Parameters:"
PRINT, parameters(0:(p)), Format='(F11.6)'
PRINT, ''
PRINT, " ** Forecast Table **"
PRINT, "Orig. Series Forecast Prob. Limits PSI Weights"
FOR i=0L, n_predict-1 DO $
PRINT, x(n_obs+i), outlier_forecast(i,0), $
outlier_forecast(i,1), outlier_forecast(i,2), $
Format='(F10.4, 3F13.4)'
Method 3: Specified ARIMA model
Model chosen: p=3, q=2, s=1, d=0
Number of outliers: 1
Outlier statistics:
Time point Outlier type
109 0
RSE: 0.412409
AIC: 408.076813
Parameters:
0.509478
1.944665
-1.901104
0.901657
1.113017
-0.914998
** Forecast Table **
Orig. Series Forecast Prob. Limits PSI Weights
8.7000 9.1109 0.8083 0.8316
8.6000 9.1811 1.0513 0.6312
9.3000 9.5185 1.1686 0.5480
9.1000 9.7804 1.2497 0.6157
8.8000 9.7117 1.3451 0.7245
8.5000 9.3842 1.4671 0.7326