NAG Library Routine Document
G13AGF accepts a series of new observations of a time series, the model of which is already fully specified, and updates the ‘state set’ information for use in constructing further forecasts. The previous specifications of the time series model should have been obtained by using G13AEF
to estimate the relevant parameters. The supplied state set will originally have been produced by G13AEF
, but may since have been updated by earlier calls to G13AGF.
A set of residuals corresponding to the new observations is returned. These may be of use in checking that the new observations conform to the previously fitted model.
|SUBROUTINE G13AGF (
||ST, NST, MR, PAR, NPAR, C, ANX, NUV, ANEXR, WA, NWA, IFAIL)
||NST, MR(7), NPAR, NUV, NWA, IFAIL
||ST(NST), PAR(NPAR), C, ANX(NUV), ANEXR(NUV), WA(NWA)
The time series model is specified as outlined in Section 3 in G13AEF
. This also describes how the state set, which contains the minimum amount of time series information needed to construct forecasts, is made up of
||the differenced series (uncorrected for the constant ), for ,
||the values required to reconstitute the original series from the differenced series ,
||the intermediate series
||the residual series , for .
If the number of original undifferenced observations was , then and .
To update the state set, given a number of new undifferenced observations , , the four series above are first reconstituted.
Differencing and residual calculation operations are then applied to the new observations and new values of and are derived.
The first values in these three series are then discarded and a new state set is obtained.
The residuals in the series corresponding to the new observations are preserved in an output array. The parameters of the time series model are not changed in this routine.
- 1: ST(NST) – REAL (KIND=nag_wp) arrayInput/Output
: the state set derived from G13AEF
, or as modified using earlier calls of G13AGF.
On exit: the updated values of the state set.
- 2: NST – INTEGERInput
: the number of values in the state set array ST
. (As returned by G13AEF
- 3: MR() – INTEGER arrayInput
On entry: the orders vector of the ARIMA model, in the usual notation.
- if , ;
- if , .
- 4: PAR(NPAR) – 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 in the model – in that order, using the usual notation.
- 5: NPAR – INTEGERInput
On entry: the number of , , and parameters in the model.
- 6: C – REAL (KIND=nag_wp)Input
On entry: the constant to be subtracted from the differenced data.
- 7: ANX(NUV) – REAL (KIND=nag_wp) arrayInput
: the new undifferenced observations which are to be used to update ST
- 8: NUV – INTEGERInput
, the number of new observations in ANX
- 9: ANEXR(NUV) – REAL (KIND=nag_wp) arrayOutput
: the residuals corresponding to the new observations in ANX
- 10: WA(NWA) – REAL (KIND=nag_wp) arrayWorkspace
- 11: NWA – INTEGERInput
: the dimension of the array WA
as declared in the (sub)program from which G13AGF is called.
- 12: IFAIL – INTEGERInput/Output
must be set to
. If you are unfamiliar with this parameter you should refer to Section 3.3
in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value
is recommended. If the output of error messages is undesirable, then the value
is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is
. When the value is used it is essential to test the value of IFAIL on exit.
unless the routine detects an error or a warning has been flagged (see Section 6
6 Error Indicators and Warnings
If on entry
, explanatory error messages are output on the current error message unit (as defined by X04AAF
Errors or warnings detected by the routine:
|or||the orders vector MR is invalid (check the constraints in Section 5).|
The computations are believed to be stable.
The time taken by G13AGF is approximately proportional to .
The following program is based on data derived from a study of monthly airline passenger totals (in thousands) to which a logarithmic transformation had been applied. The time series model was based on seasonal and non-seasonal differencing both of order
, with seasonal period
. The number of parameters estimated was two: a non-seasonal moving average parameter
and a seasonal moving average parameter
. There was no constant correction. These, together with the state set array, were obtained using G13AEF
Twelve new observations are supplied. The routine updates the state set and outputs a set of residuals corresponding to the new observations.
9.1 Program Text
Program Text (g13agfe.f90)
9.2 Program Data
Program Data (g13agfe.d)
9.3 Program Results
Program Results (g13agfe.r)