NAG Library Routine Document
G13BJF
1 Purpose
G13BJF produces forecasts of a time series (the output series) which depends on one or more other (input) series via a previously estimated multi-input model for which the state set information is not available. The future values of the input series must be supplied. In contrast with
G13BHF the original past values of the input and output series are required. Standard errors of the forecasts are produced. If future values of some of the input series have been obtained as forecasts using ARIMA models for those series, this may be allowed for in the calculation of the standard errors.
2 Specification
SUBROUTINE G13BJF ( |
MR, NSER, MT, PARA, NPARA, KFC, NEV, NFV, XXY, LDXXY, KZEF, RMSXY, MRX, PARX, LDPARX, FVA, FSD, STTF, ISTTF, NSTTF, WA, IWA, MWA, IMWA, IFAIL) |
INTEGER |
MR(7), NSER, MT(4,NSER), NPARA, KFC, NEV, NFV, LDXXY, KZEF, MRX(7,NSER), LDPARX, ISTTF, NSTTF, IWA, MWA(IMWA), IMWA, IFAIL |
REAL (KIND=nag_wp) |
PARA(NPARA), XXY(LDXXY,NSER), RMSXY(NSER), PARX(LDPARX,NSER), FVA(NFV), FSD(NFV), STTF(ISTTF), WA(IWA) |
|
3 Description
G13BJF has two stages. The first stage is essentially the same as a call to the model estimation routine
G13BEF, with zero iterations. In particular, all the parameters remain unchanged in the supplied input series transfer function models and output noise series ARIMA model. The internal nuisance parameters associated with the pre-observation period effects of the input series are estimated where requested, and so are any backforecasts of the output noise series. The output components
and
, and residuals
are calculated exactly as in
Section 3 in G13BEF, and the state set for forecasting is constituted.
The second stage is essentially the same as a call to the forecasting routine
G13BHF. The same information is required, and the same information is returned.
Use of G13BJF should be confined to situations in which the state set for forecasting is unknown. Forecasting from the original data is relatively expensive because it requires recalculation of the state set. G13BJF returns the state set for use in producing further forecasts using
G13BHF, or for updating the state set using
G13BGF.
4 References
Box G E P and Jenkins G M (1976) Time Series Analysis: Forecasting and Control (Revised Edition) Holden–Day
5 Parameters
- 1: – INTEGER arrayInput
-
On entry: 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.
Constraints:
- , , , , , , ;
- ;
- ;
- if , ;
- if , ;
- ;
- .
- 2: – INTEGERInput
-
On entry: the number of input and output series. There may be any number of input series (including none), but only one output series.
- 3: – INTEGER arrayInput
-
On entry: the transfer function model orders
,
and
of each of the input series. The data for input series
is 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.
The choice leads to estimation of the pre-period input effects as nuisance parameters, and suppresses this estimation. This choice may affect the returned forecasts and the state set.
When , any nonzero contents of rows 1, 2 and 3 of column are ignored.
Constraint:
, or , for .
- 4: – REAL (KIND=nag_wp) arrayInput/Output
-
On entry: estimates of the multi-input model parameters. These are in order, firstly the ARIMA model parameters:
values of
parameters,
values of
parameters,
values of
parameters,
values of
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
.
On exit: the parameter values may be updated using an additional iteration in the estimation process.
- 5: – INTEGERInput
-
On entry: the exact number of , , , , , , parameters, so that , the summation being over all the input series. ( must be included whether its value was previously estimated or was set fixed.)
- 6: – INTEGERInput
-
On entry: must be set to if the constant was estimated when the model was fitted, and if it was held at a fixed value. This only affects the degrees of freedom used in calculating the estimated residual variance.
Constraint:
or .
- 7: – INTEGERInput
-
On entry: the number of original (undifferenced) values in each of the input and output time series.
- 8: – INTEGERInput
-
On entry: the number of forecast values of the output series required.
Constraint:
.
- 9: – REAL (KIND=nag_wp) arrayInput/Output
-
On entry: the columns of
XXY must contain in the first
NEV places, the past values of each of the input and output series, in that order. In the next
NFV places, the columns relating to the input series (i.e., columns
to
) contain the future values of the input series which are necessary for construction of the forecasts of the output series
.
On exit: if
then
XXY is unchanged except that the relevant
NFV values in the column relating to the output series (column
NSER) contain the forecast values (
FVA), but if
then the columns of
XXY contain the corresponding values of the input component series
and the values of the output noise component
, in that order.
- 10: – INTEGERInput
-
On entry: the first dimension of the array
XXY as declared in the (sub)program from which G13BJF is called.
Constraint:
.
- 11: – INTEGERInput
-
On entry: must be set to
if the relevant
NFV values of the forecasts (
FVA) are to be held in the output series column (
NSER) of
XXY (which is otherwise unchanged) on exit, and 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
XXY on exit.
- 12: – REAL (KIND=nag_wp) arrayInput/Output
-
On entry: the first
elements of
RMSXY must contain the estimated residual variance of the input series ARIMA models. In the case of those inputs for which no ARIMA model is available or its effects are to be excluded in the calculation of forecast standard errors, the corresponding entry of
RMSXY should be set to
.
On exit:
contains the estimated residual variance of the output noise ARIMA model which is calculated from the supplied series. Otherwise
RMSXY is unchanged.
- 13: – INTEGER arrayInput/Output
-
On entry: the orders array for each of the input series ARIMA models. Thus, column contains values of , , , , , , for input series . In the case of those inputs for which no ARIMA model is available, the corresponding orders should be set to .
On exit: unchanged, except for column
NSER which is used as workspace.
- 14: – REAL (KIND=nag_wp) arrayInput
-
On entry: values of the parameters (
,
,
, and
) for each of the input series ARIMA models.
Thus column contains values of , values of , values of and values of , in that order.
Values in the columns relating to those input series for which no ARIMA model is available are ignored.
- 15: – INTEGERInput
-
On entry: the first dimension of the array
PARX as declared in the (sub)program from which G13BJF is called.
Constraint:
, where is the maximum number of parameters in any of the input series ARIMA models. If there are no input series, then .
- 16: – REAL (KIND=nag_wp) arrayOutput
-
On exit: the required forecast values for the output series. (Note that these are also output in column
NSER of
XXY if
.)
- 17: – REAL (KIND=nag_wp) arrayOutput
-
On exit: the standard errors for each of the forecast values.
- 18: – REAL (KIND=nag_wp) arrayOutput
-
On exit: the
NSTTF values of the state set based on the first
NEV sets of (past) values of the input and output series.
- 19: – INTEGERInput
-
On entry: the dimension of the array
STTF as declared in the (sub)program from which G13BJF is called.
Constraint:
, where and the summation is over all input series for which .
- 20: – INTEGEROutput
-
On exit: the number of values in the state set array
STTF.
- 21: – REAL (KIND=nag_wp) arrayWorkspace
- 22: – INTEGERInput
-
On entry: the dimension of the array
WA as declared in the (sub)program from which G13BJF is called.
It is not practical to outline a method for deriving the exact minimum permissible value of
IWA, but the following gives a reasonably good approximation which tends to be on the conservative side.
Note: there are three error indicators associated with
IWA. These are
,
or
. The first of these probably indicates an abnormal entry value of
NFV, while the second indicates that
IWA is much too small and needs to be increased by a substantial amount. The last of these indicates that
IWA is too small but returns the necessary minimum value in
.
Let and , where the output noise ARIMA model orders are , , , , , , .
Let there be
input series, where
.
Let | , | if
, for , if |
| , | if
, for , if |
where the transfer function model orders of input series
are given by
,
,
,
.
Let
Let and .
Finally, let , and then increment by every time any of the following conditions are satisfied. (The last two conditions should be applied separately to each input series, so that for example if we have two input series and and , then is incremented by in respect of these.)
The conditions are:
- , separately, for , if
- , separately, for , if ,
then .
- 23: – INTEGER arrayWorkspace
- 24: – INTEGERInput
-
On entry: the dimension of the array
MWA as declared in the (sub)program from which G13BJF is called.
Constraint:
.
The derivation of
is described under
IWA.
When
IMWA is too small, as indicated by
, the requisite minimum value of
IMWA is returned in
.
- 25: – INTEGERInput/Output
-
On entry:
IFAIL 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.
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
or
, explanatory error messages are output on the current error message unit (as defined by
X04AAF).
Errors or warnings detected by the routine:
-
On entry, | , |
or | , |
or | , |
or | . |
-
On entry,
LDPARX is too small or
NPARA is inconsistent with the orders specified in arrays
MR and
MT; or one of the
, stored in
, does not equal
,
or
.
-
On entry or during execution, one or more sets of parameters do not satisfy the stationarity or invertibility test conditions.
-
On entry,
IWA is too small for the final forecasting calculations. This is a highly unlikely error, and would probably indicate that
NFV was abnormally large.
-
On entry,
IWA is too small by a very considerable margin. No information is supplied about the requisite minimum size.
-
On entry, | IWA is too small, but the requisite minimum size is returned in . |
-
On entry, | IMWA is too small, but the requisite minimum size is returned in . |
-
This indicates a failure in
F04ASF which is used to solve the equations giving the latest estimates of the parameters.
-
This indicates a failure in the inversion of the second derivative matrix associated with parameter estimation.
-
On entry or during execution, one or more sets of the ARIMA (, , or ) parameters do not satisfy the stationarity or invertibility test conditions.
-
On entry, | ISTTF is too small. |
An unexpected error has been triggered by this routine. Please
contact
NAG.
See
Section 3.8 in the Essential Introduction for further information.
Your licence key may have expired or may not have been installed correctly.
See
Section 3.7 in the Essential Introduction for further information.
Dynamic memory allocation failed.
See
Section 3.6 in the Essential Introduction for further information.
7 Accuracy
The computations are believed to be stable.
8 Parallelism and Performance
G13BJF is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
G13BJF makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the
X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the
Users' Note for your implementation for any additional implementation-specific information.
The time taken by G13BJF is approximately proportional to the product of the length of each series and the square of the number of parameters in the multi-input model.
10 Example
The data in this example relates to
observations of an output time series and
input time series. The output series has one autoregressive
parameter and one seasonal moving average
parameter, with initial values
,
and
. The seasonal period is
.
This example differs from the example in
G13BEF in that four of the input series are simple series and the fifth is defined by a transfer function with orders
,
,
,
, which allows for pre-observation period effects. The initial values for the transfer model are:
-
A further values of the input series are supplied, and it is assumed that the values for the fifth series have themselves been forecast from an ARIMA model with orders in which , , , and , and for which the residual mean square is .
The following are computed and printed out: the state set after initial processing of the original sets of values, the estimated residual variance for the output noise series, the forecast values and their standard errors, and the values of the components and the output noise component .
10.1 Program Text
Program Text (g13bjfe.f90)
10.2 Program Data
Program Data (g13bjfe.d)
10.3 Program Results
Program Results (g13bjfe.r)