Legacy Documentation

Time Series (2011)

This is documentation for an obsolete product.
Current products and services

Previous section-----Next section

1.7.3 Updating the Forecast

Another advantage of using the approximate forecast formula is that the forecast can be easily updated when new observations are available. From (7.7) the forecast error for the prediction is given by . And the difference en(h+1)-en+1(h) is . Setting h=1, we get . So we have
This is the desired formula for updating the forecast. That is, once Xn+1 is known, we know the actual forecast error en(1), and the forecast value for Xn+h+1 is modified by a quantity proportional to en(1). Equation (7.10) allows us to get the forecasts based on n+1 observations from the forecasts based on n observations. Note that the updating formula is for the approximate best linear predictor only.
As an exercise, let us try to write a program implementing (7.10). We want to find the forecasts {} of the time series given the model, the old forecast values {}, and the new available value Xn+1. The weights can be obtained by extracting the first argument of ToMAModel. A simple function that performs the updating can be written as follows.
In[24]:=
In[25]:=
In[26]:=
In[27]:=
Suppose that only the first 40 data points are available and we predict the next four points.
In[28]:=
Out[28]=
When the 41st data point is given, the prediction based on the 41 data points can be obtained from the old prediction using newforecast.
In[29]:=
Out[29]=
Note that the new forecast has a different lead time as well as forecast origin. Note also that the mean square forecast errors are not updated. They are given by (7.8) and remain the same independent of the forecast origin since they are the mean square forecast errors in the infinite sample case.
These updated forecast values are indeed the same as those had we done the forecast with 41 data points in the first place.
In[30]:=
Out[30]=
Example 7.7 Suppose more than one new observation is made available, we can recursively update the forecast using the Mathematica internal function Fold and newforecast defined above. Suppose initially we make a forecast of a lead time 10 based on n=40 data points and later 5 new data points are obtained. We can update our forecast based on the new available information as follows. (The same data and model as in Example 7.6 are used to illustrate this.)
In[31]:=
In[32]:=
In[33]:=
Out[33]=
In[34]:=
Out[34]=
In[35]:=
Out[35]=