NAG FL Interface
g13bgf (multi_inputmod_update)
1
Purpose
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.
2
Specification
Fortran Interface
Subroutine g13bgf ( |
sttf, nsttf, mr, nser, mt, para, npara, nnv, xxyn, ldxxyn, kzef, res, wa, iwa, ifail) |
Integer, Intent (In) |
:: |
nsttf, mr(7), nser, mt(4,nser), npara, nnv, ldxxyn, kzef, iwa |
Integer, Intent (Inout) |
:: |
ifail |
Real (Kind=nag_wp), Intent (In) |
:: |
para(npara) |
Real (Kind=nag_wp), Intent (Inout) |
:: |
sttf(nsttf), xxyn(ldxxyn,nser) |
Real (Kind=nag_wp), Intent (Out) |
:: |
res(nnv), wa(iwa) |
|
C Header Interface
#include <nag.h>
void |
g13bgf_ (double sttf[], const Integer *nsttf, const Integer mr[], const Integer *nser, const Integer mt[], const double para[], const Integer *npara, const Integer *nnv, double xxyn[], const Integer *ldxxyn, const Integer *kzef, double res[], double wa[], const Integer *iwa, Integer *ifail) |
|
C++ Header Interface
#include <nag.h> extern "C" {
void |
g13bgf_ (double sttf[], const Integer &nsttf, const Integer mr[], const Integer &nser, const Integer mt[], const double para[], const Integer &npara, const Integer &nnv, double xxyn[], const Integer &ldxxyn, const Integer &kzef, double res[], double wa[], const Integer &iwa, Integer &ifail) |
}
|
The routine may be called by the names g13bgf or nagf_tsa_multi_inputmod_update.
3
Description
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
for
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.
4
References
Box G E P and Jenkins G M (1976) Time Series Analysis: Forecasting and Control (Revised Edition) Holden–Day
5
Arguments
-
1:
– Real (Kind=nag_wp) array
Input/Output
-
On entry: the
nsttf values in the state set before updating as returned by
g13bef or
g13bjf, or a previous call to
g13bgf.
On exit: the state set values after updating.
-
2:
– Integer
Input
-
On entry: the exact number of values in the state set array
sttf as returned by
g13bef or
g13bjf.
-
3:
– Integer array
Input
-
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 , .
-
4:
– Integer
Input
-
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:
– Integer array
Input
-
On entry: the transfer function model orders
,
and
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 or 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.
Constraint:
, or , for .
-
6:
– Real (Kind=nag_wp) array
Input
-
On entry: estimates of the multi-input model parameters as returned by
g13bef. These are in order, firstly the ARIMA model parameters:
values of
parameters,
values of
parameters,
values of
parameters and
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
.
-
7:
– Integer
Input
-
On entry: the exact number of , , , , , and parameters. ( must be included whether its value was previously estimated or was set fixed.)
-
8:
– Integer
Input
-
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:
– Real (Kind=nag_wp) array
Input/Output
-
On entry: the
nnv new observation sets being used to update the state set. Column
contains the values of input series
, for
. Column
contains the values of the output series. Consecutive rows correspond to increasing time sequence.
On exit: if
,
xxyn remains unchanged.
If
, the columns of
xxyn hold the corresponding values of the input component series
and the output noise component
in that order.
-
10:
– Integer
Input
-
On entry: the first dimension of the array
xxyn as declared in the (sub)program from which
g13bgf is called.
Constraint:
.
-
11:
– Integer
Input
-
On entry: 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
if
xxyn is to remain unchanged on exit.
-
12:
– Real (Kind=nag_wp) array
Output
-
On exit: the values of the residual series corresponding to the new observations of the output series.
-
13:
– Real (Kind=nag_wp) array
Output
-
14:
– Integer
Input
-
These arguments are no longer accessed by g13bgf. Workspace is provided internally by dynamic allocation instead.
-
15:
– Integer
Input/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).
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,
.
Constraint:
nsttf,
mr and
mt must be consistent.
-
On entry,
.
Constraint:
npara,
mr and
mt must be consistent.
-
On entry, and .
Constraint: .
-
On entry, and .
Constraint: , or .
On entry, the orders vector
mr is invalid.
An unexpected error has been triggered by this routine. Please
contact
NAG.
See
Section 7 in the Introduction to the NAG Library FL Interface for further information.
Your licence key may have expired or may not have been installed correctly.
See
Section 8 in the Introduction to the NAG Library FL Interface for further information.
Dynamic memory allocation failed.
See
Section 9 in the Introduction to the NAG Library FL Interface for further information.
7
Accuracy
The computations are believed to be stable.
8
Parallelism and Performance
g13bgf is not threaded in any implementation.
The time taken by g13bgf is approximately proportional to .
10
Example
This example uses the data described in
g13bef in which
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.
10.1
Program Text
10.2
Program Data
10.3
Program Results