For the purpose of forecasting, we wish to detect statistically significant changes in the model we are using to produce forecasts. Thus, in order to improve forecasts, we propose to use a cost function, C(·), based upon the log-likelihood of our time series model. In the following, we describe this for the case of using an autoregressive moving average (ARMA) model for forecasting our time series. For an overview of the use of ARMA models in time series, we refer the reader to Shumway and Stoffer
(2000).
Suppose the time series we are trying to forecast, {yt}t=1,...,n is not stationary. To
model this non-stationarity, we can segment the data into stationary autoregressive moving average (ARMA) processes. Let the ith segment of the series, y
τi−1+1:τi, be
modelled by the ARMA(pi,qi) process
yτi−1:τi =µi+
θi(B)
φi(B)
t,i,
whereφi(B) is the autoregressive operator and θi(B) is the moving average operator,
each represented as a polynomial in the backwards shift operator given as
φi(B) = 1−φi,1B−. . .−φi,piB
pi,
θi(B) = 1 +θi,1B+. . .+θi,qiB
qi,
and the noise processt,i is i.i.d. with mean zero and variance σ2i. Note that as well
as allowing both the order of the ARMA model to change, and the coefficients of the fitted model, we are also allowing for a change in mean level to occur by the inclusion of µi.
It is often the case that our time series will also have some seasonality structure with seasonal cycle of lengthf. For example, the GDP data in Figure 3.1 is quarterly data and we may wish to model this cyclic variation and allow for changes in the season- ality structure. In this instance, we can model yτi−1+1:τi as a multiplicative seasonal
autoregressive moving average process, denoted ARMA(pi,qi)×(Pi,Qi)f, and write
yτi−1:τi =µi+
θi(B)Θi(Bf)
φi(B)Φi(Bf)
t,i, (3.1)
tors, respectively, given by
Φi(B) = 1−Φi,1Bf −. . .−Φi,piB
f Pi,
Θi(B) = 1 + Θi,1Bf +. . .+ Θi,qiB
f Qi.
In addition to exclusively modelling the response time series, it may also be necessary to include external regressors into the model. In this situation we model the ith
segment of the series as linear regression model with seasonal ARMA errors. In this case we have
yt=β0,i+β1,ix1,t+. . .+βk,ixk,t+rt,i, τi−1 < t≤τj,
where the linear regression residuals follow a seasonal ARMA process as in equation (3.3) andx= (x1, . . . , xk) are the explanatory variables. When the model is estimated,
it is important to remember that we minimize the sum of squared valuest,i, and not
the rt,i.
Having specified the model for each of the segments of our data, we can detect the locations of changes in the regression model for the time series by incorporating twice the negative log-likelihood of the model into the optimisation problem in equation (2.4). Appendix 3.A outlines a procedure for doing this in practice.
3.3.1
Forecasting
Once we have detected changes in the model we are using to forecast, we then forecast the time series based on the most recent segment of data using the model for that segment. As a consequence of this approach, once a changepoint has occurred, we are deeming pre-change data uninformative. Recall, from Chapter 2, that when detecting
multiple changepoints we impose a minimum segment length,g, such thatτi+1−τi ≥
g ≥ 2. It important that our minimum segment length is not set so small such we are producing out-of-sample forecasts based only on a small amount of data. In particular, if the data has seasonality, then we must allow enough observations in a segment to estimate this seasonality. Also, the longer the minimum segment length, the more time we have to wait to detect a change. Consequently, we could be fitting an incorrect model to the last segment of the data therefore introducing bias into our model. In addition to this, penalty choice is important because it allow us to control the sensitivity of the changepoint algorithm, if we set it high, then we are only concerned with macro changes that occur in the data, if we set it low, then we wish to detect more changes.
The combination of penalty and minimum segment length can have a large influence on the detected changepoint locations and hence the window we are using to estimate our forecasting model. The combination of these two allows us to control the trade off between the bias and variance of our forecasts. As such, in practice, one could com- pare, or combine, multiple forecasting models based upon the different segmentations obtained when changing the combination of minimum segment length and penalty. In the next section, we test the performance of the methodology described here in a simulation study.