NAG Library Routine Document
G13BGF accepts a series of new observations of an output time series and any associated input time series, for which a multi-input model is already fully specified, and updates the ‘state set’ information for use in constructing further forecasts.
The previous specification of the multi-input model will normally have been obtained by using G13BEF
to estimate the relevant transfer function and ARIMA parameters. The supplied state set will originally have been produced by G13BEF
(or possibly G13BJF
), but may since have been updated by G13BGF.
|SUBROUTINE G13BGF (
||STTF, NSTTF, MR, NSER, MT, PARA, NPARA, NNV, XXYN, LDXXYN, KZEF, RES, WA, IWA, IFAIL)
||NSTTF, MR(7), NSER, MT(4,NSER), NPARA, NNV, LDXXYN, KZEF, IWA, IFAIL
||STTF(NSTTF), PARA(NPARA), XXYN(LDXXYN,NSER), RES(NNV), WA(IWA)
The multi-input model is specified in Section 3
in G13BEF. The form of these equations required to update the state set is as follows:
the transfer models which generate input component values
from one or more inputs
which generates the output noise component from the output
and the input components, and
the ARIMA model for the output noise which generates the residuals
The state set (as also given in Section 3
in G13BEF) is the collection of terms
up to the maximum lag associated with each of these series respectively, in the above model equations.
is the latest time point of the series from which the state set has been generated.
The routine accepts further values of the series , , for , and applies the above model equations over this time range, to generate new values of the various model components, noise series and residuals. The state set is reconstructed, corresponding to the latest time point , the earlier values being discarded.
The set of residuals corresponding to the new observations may be of use in checking that the new observations conform to the previously fitted model. The components of the new observations of the output series which are due to the various inputs, and the noise component, are also optionally returned.
The parameters of the model are not changed in this routine.
Box G E P and Jenkins G M (1976) Time Series Analysis: Forecasting and Control (Revised Edition) Holden–Day
- 1: STTF(NSTTF) – REAL (KIND=nag_wp) arrayInput/Output
: the NSTTF
values in the state set before updating as returned by G13BEF
, or a previous call to G13BGF.
On exit: the state set values after updating.
- 2: NSTTF – INTEGERInput
: the exact number of values in the state set array STTF
as returned by G13BEF
- 3: MR() – INTEGER arrayInput
: the orders vector
of the ARIMA model for the output noise component.
, , and refer respectively to the number of autoregressive , moving average , seasonal autoregressive and seasonal moving average parameters.
, and refer respectively to the order of non-seasonal differencing, the order of seasonal differencing, and the seasonal period.
- , , , , , , ;
- if , ;
- if , .
- 4: NSER – INTEGERInput
On entry: the total number of input and output series. There may be any number of input series (including none), but only one output series.
- 5: MT(,NSER) – INTEGER arrayInput
: the transfer function model orders
of each of the input series. The data for input series
are held in column
. Row 1 holds the value
, row 2 holds the value
and row 3 holds the value
. For a simple input,
Row 4 holds the value , where for a simple input and for a transfer function input. When any nonzero contents of rows 1, 2 and 3 of column are ignored. The choice of or is an option for use in model estimation and does not affect the operation of G13BGF.
, or , for .
- 6: PARA(NPARA) – REAL (KIND=nag_wp) arrayInput
: estimates of the multi-input model parameters as returned by G13BEF
. These are in order, firstly the ARIMA model parameters:
parameters. These are followed by the transfer function model parameter values
for the first of any input series and similarly for each subsequent input series. The final component of PARA
is the value of the constant
- 7: NPARA – INTEGERInput
On entry: the exact number of , , , , , and parameters. ( must be included whether its value was previously estimated or was set fixed.)
- 8: NNV – INTEGERInput
On entry: the number of new observation sets being used to update the state set, each observation set consisting of a value of the output series and the associated values of each of the input series at a particular time point.
- 9: XXYN(LDXXYN,NSER) – REAL (KIND=nag_wp) arrayInput/Output
: the NNV
new observation sets being used to update the state set. Column
contains the values of input series
contains the values of the output series. Consecutive rows correspond to increasing time sequence.
, the columns of XXYN
hold the corresponding values of the input component series
and the output noise component
in that order.
- 10: LDXXYN – INTEGERInput
: the first dimension of the array XXYN
as declared in the (sub)program from which G13BGF is called.
- 11: KZEF – INTEGERInput
: must not be set to
, if the values of the input component series
and the values of the output noise component
are to overwrite the contents of XXYN
on exit, and must be set to
is to remain unchanged on exit.
- 12: RES(NNV) – REAL (KIND=nag_wp) arrayOutput
On exit: the values of the residual series corresponding to the new observations of the output series.
- 13: WA(IWA) – REAL (KIND=nag_wp) arrayWorkspace
- 14: IWA – INTEGERInput
: the dimension of the array WA
as declared in the (sub)program from which G13BGF is called.
, where .
- 15: 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:
|On entry,||NSTTF is not consistent with the orders in arrays MR and MT.|
|On entry,||NPARA is not consistent with the orders in arrays MR and MT.|
|On entry,||IWA is too small.|
On entry, one of the , stored in , for does not equal , or .
The computations are believed to be stable.
The time taken by G13BGF is approximately proportional to .
This example uses the data described in G13BEF
observations of an output time series and a single input series were processed. In this example a model which included seasonal differencing of order
was used. The
values of the state set and the
final values of PARA
then obtained are used as input to this program, together with the values of
new observations and the transfer function orders of the input series. The model used is
The following are computed and printed out: the updated state set, the residuals and the values of the components and the output noise component corresponding to the new observations.
9.1 Program Text
Program Text (g13bgfe.f90)
9.2 Program Data
Program Data (g13bgfe.d)
9.3 Program Results
Program Results (g13bgfe.r)