2.1. Model Selection Algorithms
In the literature and software, the AIC and BIC criteria can take many forms since the criterion can be multiplied by a positive constant, such as
, and a constant
can be added to the criterion without changing the model that minimizes the criterion. Parameters that are in every model, such as
and possibly a constant, can be absorbed in a constant
. For ARMA(
) models, let
be the log likelihood for the GMLE. Then the AIC and BIC criteria have the form
where
for AIC and
for BIC. From McElroy and Politis (2020, p. 360) [
14] and Huang et al. (2022) [
11],
, where
is the GMLE of the error variance of model
I and
is a constant that depends on
n. Hence, if
I is an ARMA(
) model, take
For AIC given by (6), let
, then models with
are “good,” and models with
are borderline. See Duong (1984) [
25]. Claeskens and Hjort (2008, pp. 39, 111) [
26] use slightly different formulas for AR(
p) models. Pötscher and Srinivasan (1994) [
27] multiply the Equation (
6) formulas by
.
In simulations for ARMA model selection, the model selection methods often failed to select a consistent model with high probability in that an inconsistent model was selected with probability . A model I is inconsistent due to underfitting if or . A model I is inconsistent due to overfitting if and . A model I is consistent if and or if and . If the model selection procedure were restricted to AR or MA models, then model I would be inconsistent only due to underfitting. The BIC criterion appeared to work for large n if the only models considered were the ARMA() models for . Then the only consistent model is the ARMA( model, assuming . For this set of restricted models, and tend to overfit with positive probability if , and hence do not select a consistent model with probability going to one as .
In simulations, the Pötscher (1990) [
24] method to estimate
often worked rather well. Also see Pötscher and Srinivasan (1994) [
27]. Chan, Ling, and Yau (2020) [
19] suggested that this method is reliable for
In our simulations, the method was fairly reliable for
, but some models needed much larger
n, and there were some models where the method did not simulate well. For the Pötscher (1990) [
24] method, let
be a positive integer such as
. Fit the ARMA(
) model for
. For each of these
models, compute the BIC–type criterion
where
is the GMLE estimator of the error (or innovation) variance
. This criterion is Equation (
6) divided by
n, and thus (6) could be used instead. The estimator
of
is the first local minimum of the series
. Hence
if
;
if
and
;
if
,
, and
;
if
for
and
for
; and
if
is not a local minimum for any
. Note that
is necessary for
to be a consistent estimator of
.
The following method is new and can have fewer parameters than the ARMA(
) model. Use the AIC(I) criterion of Equation (
6) after finding
as above. Then, a decrease in AIC
when one parameter is omitted suggests that the parameter was not needed. Let
be a penalty such as
(used in the simulations) or
. The algorithm computes the
for the ARMA(
) model, and fits the ARMA(
) and ARMA(
models for
. If one of the models has AIC(I)
, then the set crit = AIC(I)
. This process is repeated at each step. The value of
is updated only if a decrease of more than
from the current value of
is observed. The final model
I is the model selected by this algorithm. This additional penalty reduced underfitting. Note that
models are fitted after finding
, which fits
models. This method is faster than computing the AIC for
models. Take the ARMA(
) or ARMA(
) model that has the smallest value of
. Then at least one of
p and
q will equal
. Huang et al. (2022) [
11] use a similar method with BIC.
Remark 1.
Let the full model F be an ARMA() model. Assume that the full model does not overfit too severely, e.g., use . Let r and denote the residuals and fitted values from the full model. Let and denote the residuals and fitted values from the submodel I. Let denote the sample correlation. Empirically, good ARMA time series model selection estimators select a submodel I such that both and are very high, and the plotted points, in both an RR plot of versus r and an FF plot of versus , should cluster tightly about the identity line with zero intercept and unit slope. Then model I is often “good” for prediction, even if I underfits or overfits.
Note that where the last term acts as a constant. For large n, the term cannot get much below 0, and the term tends to be near zero if is very high so that the full model residuals and submodel residuals are nearly identical.
A lower bound on
can be found for one model selection estimator. Fit the full ARMA(
) model with the GMLE. Let
. Let the full multiple linear regression working model be
for
. Let
Do model selection for multiple linear regression using ordinary least squares and the Mallows (1973) [
28]
criterion. Let
r be the full model residuals from the full model (7). Let
be the residuals from the ordinary least squares fit to submodel
I. Let
be the number of regression parameters for model (7). For the full model,
. This method can also be used for AR(
∞) models.
Theorem 2.
Using the above notation, let model I use k parameters, including a constant. Assume the design matrix for the full working model (7) has full rank d. If , then Proof. Olive and Hawkins (2005) [
29] proved that if the design matrix has full rank
p with
n cases with
, then
Plug in
d for
p and
m for
n to get the result. □
Remark 2.
Note that implies that If then typically , , , and , will be high if . If model averaging or Bayesian methods give nearly all the weight to models I, whose residuals and fitted values are highly correlated with those of the full model, then these methods may be useful for prediction. Model averaging is sometimes used for AR(∞) models. See, for example, references in Bürkner, Gabry, and Vehtari (2020) [30] and Liao et al. (2021) [31]. 2.2. Prediction Intervals
For forecasting, predict the test data given the past training data . A large sample prediction interval (PI) for is where the coverage is eventually bounded below by as . We often want as . By construction, some of the prediction intervals will have training data coverage where , and as . A large sample PI is asymptotically optimal if it has the shortest asymptotic length: the length of converges to as where is the population shorth: the shortest interval covering at least of the mass.
The shorth estimator of the population shorth will be defined below and used to create large sample PIs that do not require knowing the distribution of the errors . If the data are , let be the order statistics. Let denote the smallest integer greater than or equal to x (e.g., ). Consider intervals that contain c cases . Compute . Then the estimator shorth(c) is the interval with the shortest length.
Suppose the data
are iid and a large sample
PI is desired for a future value
such that
as
. The shorth(
c) interval is a large sample
PI if
as
, that often has the asymptotically shortest length. Frey (2013) [
32] showed that for large
and iid data, the shorth(
) prediction interval has maximum undercoverage
, and used the large sample
PI shorth(
c) =
Some more notation is needed before deriving PIs for time series. Suppose the training data set is . The h-step ahead forecast for a future value is and the h-step ahead forecast residual is For example, a common choice for model is where is the tth residual, if if , if and if , and the forecasts are found recursively if there is data . Typically, the residuals are the 1-step ahead forecast residuals, and the fitted or predicted values are the 1-step ahead forecasts.
The following example is useful to illustrate the forecasts. The R software 4.5.3 produces and for where there are 1-step ahead forecast residuals available, often with and . In the examples, we obtain the formulas and then replace n by t so that the test-data formula is applied to the training data. Then, the general formula for an ARMA() model is for . Assume there are forecast residuals available from the training data.
Example 1.
Suppose the training data is . (a) Consider an MA(2) model: . The R software produces . Thus, and . Then, for , and for . Also, . Hence, there are 1-step ahead forecast residuals available. Similarly, for . Hence, the 2-step ahead forecast residuals are available for . Now for Hence, there are n h-step ahead forecast residuals for and
(b) Consider an ARMA(1,1) model: . For . For ,
(c) Consider an AR(1) model: . For . If , then For a weakly stationary AR(1) time series, a good estimation method will have
(d) Consider an ARIMA(1,1,1) model with : . Then , and for
(e) Consider an ARIMA(0,1,1) model with : . Then and for
(f) Consider an ARIMA(0,2,2) model with : . Then , and for
The basic idea for getting prediction intervals for the test data is now given. Find the forecast formulas for the test data
, and apply the formulas to the training data
to get forecast residuals. Assume consistent estimators are used so that the forecast residuals are consistent estimators of the forecast errors. Apply the shorth to the
forecast residuals
to get
, a PI for a future forecast error. Then the PI for
is
Since the forecast residuals tend to underestimate the forecast errors, small correction factors are needed for small
n. This idea is illustrated for ARIMA models but also applies to many other time series methods, including seasonal ARIMA models. Similar PIs and prediction regions were derived for multiple linear regression and multivariate linear regression by Olive (2013) [
33].
Often, time series PIs assume normality, and do not work well unless the errors
are iid
. For many time series models, a large sample normal
PI for
is
Suppose that as
,
and
. Thus
and
are consistent estimators of
and
, respectively. These quantities are conditional on the past, but the conditioning is suppressed. Then,
assuming Chebyshev’s inequality holds to a good approximation. Hence, the 95% Chebyshev PI (9) could have coverage as low as 74%, and the 99.7% PI could have coverage as low as 89%. If n is large, a nominal 95% PI uses while using has coverage that is eventually bounded below by 96% as . The t cutoff 1.96 tends to be too low, while the Chebyshev cutoff 5 tends to be too high, in that the PI length will be too long and the coverage too high.
Theorem 3.
Suppose the are from an MA(∞) time series model. Assume and exist.
(a) Then the sample percentiles, sample mean, sample variance, and sample shorth of the converge to the population values. Thus, the population values for from an MA(∞) model are the same as the population values for iid .
(b) For h and n sufficiently large, the shortest PI for is approximately PI (8) applied to . This result is true even if and do not exist.
Proof. Since the MA(∞) time series model is approximately an MA() time series model, where depends on the time series but not on n (and the approximation gets better for an MA(Q) model as increases), the results hold if they hold for an MA(q) model. So, suppose the are from an MA(q) model.
(a) Then, the are iid in blocks: for Hence the first block is where but . Since the sample quantities converge to the population quantities in each of the blocks, the sample quantities applied to all of the data converge to the population quantities.
(b) Similar to Example 1 (a), for Hence, there are n h-step ahead forecast residuals for and Subtracting a constant from the does not change the lengths of the population or sample shorth. Hence the shortest population covering interval is and PI (8) where this notation means that the endpoints of the sample PI converge in probability to the endpoints of the population interval. □
If the
are from an MA(
∞) time series model where
exists, then the location model is
, where the
are from an MA(
∞) time series model. Note that the convergence of the sample quantities to the population quantities in Theorem 3 may not be as fast as the convergence for iid
. An MA(
) time series model tends to be ergodic: see White (1984, p. 46) [
34]. For ergodic data from a unimodal distribution, Chen and Shao (1999) [
35] proved the sample shorth converges to the unique population shorth. Lee and Scholtes (2014) [
36] discuss when the percentiles of forecast errors are consistent for ARMA models. Theorem 3’s proof is much simpler than the proofs from the above two papers. The corresponding asymptotic Chebyshev PI for
is
The following new PI is easier to compare with Chebyshev PIs. The technique can be used to make PI (8) longer with the same center, if
c is used instead of
, which can be useful if
and the
are not iid. Let
, and let shorth(
be computed from the
. Then the large sample
shorth(
) PI for
is
where
Note that this PI is the same for all
h. For weakly stationary, causal, and invertible ARMA(
) models, this PI is too long for
h near 1, but should have short length for large
h, and if
for an MA(
q) model by Theorem 3(b). This PI is the Olive (2013) [
33] PI suggested for
when
and
are iid.
PI (10) is similar to the shorth PI (8) from Theorem 3, but has a correction factor for small n. For the MA(q) model with , for (provided and ), for , the are identically distributed for fixed h, and the random variables are iid for fixed . For , there are h iid sequences starting at , respectively. For , there are iid sequences starting at . Since the sample percentiles of the iid sequences converge in probability to the population percentiles for fixed h, so do the sample percentiles of all of the data. Hence as for the MA(q) model. Then Hence, PI (10) is a large sample PI for if the are from an MA(∞) time series model where exists.
Using the forecast residuals from the training data for to create a PI may not work well if is too small. For the MA(q) model with , need with . Also, the may not be available from the software. Then, using PI (10) or the shorth PI (8) computed from the makes sense. These PIs may outperform the widely used Chebyshev PIs for coverage and length, even for rather small h. The shorth PI (8) also works for heavy-tailed data where the forecast error variance does not exist.
The following PI is new and takes into account the time-series structure of the data. A similar idea in Masters (1995, p. 305) [
37] is to find the
h-step ahead forecast residuals and use percentiles to make PIs for
for
. Let the full model be the ARMA(
) model. Let
be the ARMA
) model that was selected by the model selection algorithm. Often
Find
and the forecast residuals
for the selected model
. For
, we will use the residuals
Let
, and
Let
for
and
otherwise. If
and
, set
. Then, compute the shorth(
) PI
from the
scaled forecast residuals
with
If the Pötscher (1990) [
24] method is used, then the new large sample
PI for
is
Note that for
, an estimator for
is
by Equation (
2), suggesting that
Since the residuals
from many models
I are nearly identical by Remark 1, these models give very similar
and
for large
n. For
, since the fitted values are nearly identical on the training data for many models, expect the
h-step ahead forecasts and residuals to be similar for small
h.
In addition to the above paragraph, why might PIs (12) have good coverage? For both the test data and the training data, . First, consider the training data where forecast residuals exist. Then the proportion of the proportion of the forecast residuals by construction. Hence the training data coverage is good. If the selected fitted model is good, and the test data behaves like the training data, then we expect the test data coverage to be good for large n.
Second, assume the time series follow a weakly stationary ARMA model, and suppose
is a consistent estimator of
and
estimates
in that
as
Also assume that the percentiles of
estimate the percentiles of
such that
as
. Then
. These assumptions are roughly the assumptions made when normality is assumed, which makes the time series strictly stationary. For
, the
estimate the iid
for many models
I, and these assumptions may be reasonable if
n is large. If the model selection estimator selects a consistent estimator with probability that goes to 1 as
, then the model selection estimator tends to be consistent by Haile and Olive (2023) [
3]. For MA(
∞) models (weakly stationary causal ARMA models),
,
, and
estimates
as
.
2.3. Example and Simulations
Model selection can be done using the
R function
auto.arima from the Hyndman and Khandakar (2008) [
38]
forecast package. Also, see Hyndman and Athanasopoulos (2018) [
39]. The AIC and BIC criteria used by this function differ from those given by Equation (
6).
Example 2.
The monthly Brent crude oil spot price (dollars per barrel) with 396 observations was collected over the period of 01/1990–12/2022. The differenced time series did not have constant variance. Hence, the differenced time series of log(price) was used. The plot of time series in Figure 1 shows several outliers, cases 7, 8, 362, 363, 364, and 365, which create white space in the plot. The outliers near 2020 may be due to COVID-19. These six outliers were replaced by missing values. Hence, if is the original time series, then is the new time series with if is not one of the outliers, and if was an outlier, where NA is R
notation for missing values. This new technique for handling outliers is useful if the time series software can handle missing values. See Figure 2 for the plot of . The auto.arima function was used for model selection and picked an AR(1) model, which appeared to be reasonable from ACF and PACF plots. The new model selection procedure and the Pötscher method both selected an ARMA(1,1) model, which is consistent if the AR(1) model is consistent. The large sample 95% PI (10) (computed from the 389 values that were not missing) was and contained of the 389 . If the last nine were omitted, then the large sample 95% PI (10) (computed from the 380 values that were not missing) was and contained all 9 of the future cases Next we computed the large sample 95% PI (10) using to for and determined whether was in the PI (10 steps ahead, ignoring missing values). This occurred for of the PIs, and the average PI length was 0.372. Some R code is shown below.
library(forecast)
d1=diff(log(d$price))
d1[c(7,8,362,363,364,365)] <- NA
pricets=ts(d1,frequency=12, start=c(1990,1))
plot.ts(pricets, main="The Difference Series of the Logs of the Oil Price",
xlab="Year", ylab="Price",type="o")
d2 <- d1[-c(7,8,362,363,364,365)]
locpi(d2)
d3 <- d2[1:380]
locpi(d3) #get rolling forecasts
cov <- 0
len <- 1:150
for(i in 1:150){
dd <- d2[i:(i+99)]
temp <- locpi(dd)
yf <- d2[i+109]
if(temp$LPI <= yf && yf <= temp$UPI)
cov<-cov+1
len[i] <- temp$UPI-temp$LPI }
Figure 1.
Differenced series of logs of oil price.
Figure 1.
Differenced series of logs of oil price.
Figure 2.
Differenced series of logs of oil price using NA.
Figure 2.
Differenced series of logs of oil price using NA.
For the model selection and PI simulations, there were four error types for the iid : (1) N(0,1), (2) , (3) , or (4) (EXP(1) − 1), a shifted exponential distribution. All these distributions have mean 0, but the fourth distribution is not symmetric. The 6 time series types were tstype = 1 for an AR(1) model with , tstype = 2 for an AR(2) model with , tstype = 3 for an MA(1) model with , tstype = 4 for an MA(2) model with , tstype = 5 for an ARMA(3,1) model with and . Finally, tstype = 6 allows the user to specify and for an ARMA() model with , , and , where kmax is the largest value of r for the fitted ARMA() models, kmax.
Model Selection Simulations
We used the
auto.arima function with “AIC”, the Pötscher (1990) [
24] method that selects an ARMA(
) model, and the new ARMA model selection method given in
Section 2.1. In
Table 1 and
Table 2, these methods are denoted by R AIC,
, and
I, respectively. AIC was used with
auto.arima since in the simulations for
, underfitting was much more of a problem than overfitting. The simulations give the proportion of times a consistent model
I was selected. Thus
and
or
and
.
For the 6 time series types, searching all 36 models with auto.arima would select a consistent model about 75% to 96% of the time if the true model was AR(p) or MA(q) and n was large (tstype 1 to 4), but it did not perform well for ARMA(1,1) models.
The ARMA models were sensitive to the values of and . For ARMA(1,1) models with
the Pötscher method worked well with
, but
did not. In the simulations, the Pötscher model selection method could work fairly well for
n as low as 80, and often worked fairly well for
, but often much larger sample sizes were needed. The tstype = 5 model needed
. Chan, Ling, and Yau (2020) [
19] suggested that the Pötscher (1990) [
24] method is reliable for
. More simulations are presented in Welagedara (2023) [
40].
For the simulated ARMA(1,1) time series in
Table 1, the Pötscher (1990) [
24] and new methods picked a consistent model in at least 94% of the runs (were reliable) for
, while
auto.arima with AIC picked an inconsistent model in at least 69% of the 1000 runs (was unreliable).
Table 2 used the tstype = 5 = ARMA(3,1) model. The new method was fairly reliable for
, while
auto.arima with AIC picked an inconsistent model in at least 47% of the 1000 runs.
Prediction Intervals after Model Selection
For ease of programming, we used one-step ahead prediction intervals after model selection using the
auto.arima function, the GMLE, and
. Haile (2022) [
41] provided additional prediction intervals and simulations. With 5000 runs, coverages between 0.94 and 0.96 suggest that there is no reason to believe that the nominal coverage is not 0.95. The iid error distributions for
were N(0,1),
,
, or (EXP(1) − 1), a shifted exponential distribution. For
, the asymptotic optimal lengths of the 95% PIs are 3.92, 5.141, 1.9, and 2.996, while the asymptotic lengths of the normal (Chebyshev) nominal 95% PIs are
= 3.92, 5.061, 2.263, and 3.92 for the N(0,1),
,
, and (EXP(1) − 1) distributions, respectively. By Theorem 3, for MA(
∞) time series, using iid data formulas, the asymptotic coverages of the nominal 95% Chebyshev intervals for the four error distributions are 0.95, 0.948, 1.00, and 0.948.
Table 3 gives some results for nominal 95% PIs. The full model was the ARMA(5,5) model. The true model was an MA(2) model. PIs (9) and (12) were used, as well as the normal (Chebyshev) nominal 95% PI from
auto.arima, denoted by (F). Two lines were provided for each distribution-sample size combination. The first line gives the simulated coverage, which tended to be higher than 0.94. The second line gives the average PI length. PIs (9) and (F) were very similar. For
, the PI lengths and coverages were close to their asymptotic values.
In limited simulations, one-step ahead prediction intervals (12) and the Chebyshev “95%”
h-step ahead prediction intervals (10) simulated fairly well after model selection using
auto.arima or the Pötscher method. Prediction interval (10) does not depend on model selection. For example, in
Table 4, the true model was an ARMA(
) model, the
were iid
, A stands for
auto.arima, and P stands for the Pötscher method. PI (10) does not depend on the model selection method; hence, the coverage and length were provided for A but not for P. For PI (12) and PI (F), the coverages and lengths were similar for A and P. Note that PI (12) was slightly longer than PI (10) for P and
. Also, the PI (F) average length is close to the asymptotic length 5.061, while the PI (12) length is not as close to the asymptotically optimal length 5.141.
A random walk or AR(1) model with unit root is
. This time series model is not weakly stationary. The PIs (8) and (10) are valid for AR(1) models with a near unit root, so they may simulate well for the unit root model if the iid errors have
and
.
Table 5 shows some results for one step ahead PIs when
where
auto.arima was used.
Some R code is shown below.
#Table 4, need the source command for tspack and library(forecast) arimapisim(n=400,nruns=5000,phi=0.4,theta=-0.7,tstype=6,etype=2,dd=0)
arimapisim(n=200,nruns=5000,phi=0.4,theta=-0.7,tstype=6,etype=2,dd=0)
arimapisim(n=100,nruns=5000,phi=0.4,theta=-0.7,tstype=6,etype=2,dd=0)
unitrootpisim(n=100,nruns=5000)
unitrootpisim(n=200,nruns=5000)
unitrootpisim(n=400,nruns=5000)