g13ahf produces forecasts of a time series, given a time series model which has already been fitted to the time series using g13aeforg13aff. The original observations are not required, since g13ahf uses as input either the original state set produced by g13aeforg13aff or the state set updated by a series of new observations using g13agf. Standard errors of the forecasts are also provided.
The routine may be called by the names g13ahf or nagf_tsa_uni_arima_forecast_state.
3Description
The original time series is , for and parameters have been fitted to the model of this time series using g13aeforg13aff.
Forecasts of , for , are calculated in five stages, as follows:
(i)set for , where is the number of differenced values in the series;
(ii)calculate the values of , for , and ;
(iii)calculate the values of , for , where and for are the first values in the state set, corrected for the constant;
(iv)add the constant term to give the differenced series , for ;
(v)the differencing operations are reversed to reconstitute , for .
The standard errors of these forecasts are given by , for , where , is the residual variance of , and is the coefficient expressing the dependence of on .
To calculate , for , the following device is used.
A copy of the state set is initialized to zero throughout and the calculations outlined above for the construction of forecasts are carried out with the settings , and , for .
The resulting quantities corresponding to the sequence are precisely , .
The supplied time series model is used throughout these calculations, with the exception that the constant term is taken to be zero.
4References
None.
5Arguments
1: – Real (Kind=nag_wp) arrayInput
On entry: the state set derived from g13aeforg13aff originally, or as modified using earlier calls of g13agf.
2: – IntegerInput
On entry: the number of values in the state set array st.
On entry: the orders vector of the ARIMA model, in the usual notation.
Constraints:
;
;
;
if , ;
if , .
4: – Real (Kind=nag_wp) arrayInput
On entry: the estimates of the values of the parameters, the values of the parameters, the values of the parameters and the values of the parameters which specify the model and which were output originally by g13aeforg13aff.
5: – IntegerInput
On entry: the number of , , and parameters in the model.
Constraint:
.
6: – Real (Kind=nag_wp)Input
On entry: , the value of the model constant. This will have been output by g13aeforg13aff.
7: – Real (Kind=nag_wp)Input
On entry: , the residual variance associated with the model.
If g13aff was used to estimate the model, rms should be set to , where s and ndf were output by g13aff.
If g13aef was used to estimate the model, rms should be set to , where s and were output by g13aef.
Constraint:
.
8: – IntegerInput
On entry: , the required number of forecasts.
Constraint:
.
9: – Real (Kind=nag_wp) arrayOutput
On exit: nfv forecast values relating to the original undifferenced series.
10: – Real (Kind=nag_wp) arrayOutput
On exit: the standard errors associated with each of the nfv forecast values in fva.
11: – Real (Kind=nag_wp) arrayWorkspace
12: – IntegerInput
On entry: the dimension of the array wa as declared in the (sub)program from which g13ahf is called.
Constraint:
.
13: – IntegerInput/Output
On entry: ifail must be set to , or to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of means that an error message is printed while a value of means that it is not.
If halting is not appropriate, the value or is recommended. If message printing is undesirable, then the value is recommended. Otherwise, the value is recommended. When the value or is used it is essential to test the value of ifail on exit.
On exit: unless the routine detects an error or a warning has been flagged (see Section 6).
6Error Indicators and Warnings
If on entry or , explanatory error messages are output on the current error message unit (as defined by x04aaf).