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.
the ARIMA model for the output noise which generates the residuals ${a}_{t}$.
The state set (as also given in Section 3 in g13bef) is the collection of terms
$${z}_{n+1-k},{x}_{n+1-k},{n}_{n+1-k},{w}_{n+1-k},{e}_{n+1-k}\text{\hspace{1em} and \hspace{1em}}{a}_{n+1-k}$$
for $k=1$ up to the maximum lag associated with each of these series respectively, in the above model equations. $n$ is the latest time point of the series from which the state set has been generated.
The routine accepts further values of the series ${y}_{\mathit{t}}$, ${x}_{1,\mathit{t}},{x}_{2,\mathit{t}},\dots ,{x}_{m,\mathit{t}}$, for $\mathit{t}=n+1,\dots ,n+l$, 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 $n+l$, 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.
4References
Box G E P and Jenkins G M (1976) Time Series Analysis: Forecasting and Control (Revised Edition) Holden–Day
5Arguments
1: $\mathbf{sttf}\left({\mathbf{nsttf}}\right)$ – Real (Kind=nag_wp) arrayInput/Output
On entry: the nsttf values in the state set before updating as returned by g13beforg13bjf, or a previous call to g13bgf.
On exit: the state set values after updating.
2: $\mathbf{nsttf}$ – IntegerInput
On entry: the exact number of values in the state set array sttf as returned by g13beforg13bjf.
On entry: the orders vector $(p,d,q,P,D,Q,s)$ of the ARIMA model for the output noise component.
$p$, $q$, $P$ and $Q$ refer respectively to the number of autoregressive $\left(\varphi \right)$, moving average $\left(\theta \right)$, seasonal autoregressive $\left(\Phi \right)$ and seasonal moving average $\left(\Theta \right)$ parameters.
$d$, $D$ and $s$ refer respectively to the order of non-seasonal differencing, the order of seasonal differencing, and the seasonal period.
Constraints:
$p$, $d$, $q$, $P$, $D$, $Q$, $s\ge 0$;
$p+q+P+Q>0$;
$s\ne 1$;
if $s=0$, $P+D+Q=0$;
if $s>1$, $P+D+Q>0$.
4: $\mathbf{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.
On entry: the transfer function model orders $b$, $p$ and $q$ of each of the input series. The data for input series $i$ are held in column $i$. Row 1 holds the value ${b}_{i}$, row 2 holds the value ${q}_{i}$ and row 3 holds the value ${p}_{i}$. For a simple input, ${b}_{i}={q}_{i}={p}_{i}=0$.
Row 4 holds the value ${r}_{i}$, where ${r}_{i}=1$ for a simple input and ${r}_{i}=2$ or $3$ for a transfer function input. When ${r}_{i}=1$ any nonzero contents of rows 1, 2 and 3 of column $i$ are ignored. The choice of ${r}_{i}=2$ or ${r}_{i}=3$ is an option for use in model estimation and does not affect the operation of g13bgf.
Constraint:
${\mathbf{mt}}(4,\mathit{i})=1$, $2$ or $3$, for $\mathit{i}=1,2,\dots ,{\mathbf{nser}}-1$.
6: $\mathbf{para}\left({\mathbf{npara}}\right)$ – Real (Kind=nag_wp) arrayInput
On entry: estimates of the multi-input model parameters as returned by g13bef. These are in order, firstly the ARIMA model parameters: $p$ values of $\varphi $ parameters, $q$ values of $\theta $ parameters, $P$ values of $\Phi $ parameters and $Q$ values of $\Theta $ parameters. These are followed by the transfer function model parameter values ${\omega}_{0},{\omega}_{1},\dots ,{\omega}_{{q}_{1}}$, ${\delta}_{1},{\delta}_{2},\dots ,{\delta}_{{p}_{1}}$ 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 $c$.
7: $\mathbf{npara}$ – IntegerInput
On entry: the exact number of $\varphi $, $\theta $, $\Phi $, $\Theta $, $\omega $, $\delta $ and $c$ parameters. ($c$ must be included whether its value was previously estimated or was set fixed.)
8: $\mathbf{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: $\mathbf{xxyn}({\mathbf{ldxxyn}},{\mathbf{nser}})$ – Real (Kind=nag_wp) arrayInput/Output
On entry: the nnv new observation sets being used to update the state set. Column $i$ contains the values of input series
$\mathit{i}$, for $\mathit{i}=1,2,\dots ,{\mathbf{nser}}-1$. Column ${\mathbf{nser}}$ contains the values of the output series. Consecutive rows correspond to increasing time sequence.
On exit: if ${\mathbf{kzef}}=0$, xxyn remains unchanged.
If ${\mathbf{kzef}}\ne 0$, the columns of xxyn hold the corresponding values of the input component series ${z}_{t}$ and the output noise component ${n}_{t}$ in that order.
10: $\mathbf{ldxxyn}$ – IntegerInput
On entry: the first dimension of the array xxyn as declared in the (sub)program from which g13bgf is called.
On entry: must not be set to $0$, if the values of the input component series ${z}_{t}$ and the values of the output noise component ${n}_{t}$ are to overwrite the contents of xxyn on exit, and must be set to $0$ if xxyn is to remain unchanged on exit.
12: $\mathbf{res}\left({\mathbf{nnv}}\right)$ – Real (Kind=nag_wp) arrayOutput
On exit: the values of the residual series ${a}_{t}$ corresponding to the new observations of the output series.
13: $\mathbf{wa}\left({\mathbf{iwa}}\right)$ – Real (Kind=nag_wp) arrayOutput
14: $\mathbf{iwa}$ – IntegerInput
These arguments are no longer accessed by g13bgf. Workspace is provided internally by dynamic allocation instead.
15: $\mathbf{ifail}$ – IntegerInput/Output
On entry: ifail must be set to $0$, $\mathrm{-1}$ or $1$ to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of $0$ causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of $\mathrm{-1}$ means that an error message is printed while a value of $1$ means that it is not.
If halting is not appropriate, the value $\mathrm{-1}$ or $1$ is recommended. If message printing is undesirable, then the value $1$ is recommended. Otherwise, the value $0$ is recommended. When the value $-\mathbf{1}$ or $\mathbf{1}$ is used it is essential to test the value of ifail on exit.
On exit: ${\mathbf{ifail}}={\mathbf{0}}$ unless the routine detects an error or a warning has been flagged (see Section 6).
6Error Indicators and Warnings
If on entry ${\mathbf{ifail}}=0$ or $\mathrm{-1}$, explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
${\mathbf{ifail}}=1$
On entry, ${\mathbf{nsttf}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: nsttf, mr and mt must be consistent.
${\mathbf{ifail}}=2$
On entry, ${\mathbf{npara}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: npara, mr and mt must be consistent.
${\mathbf{ifail}}=3$
On entry, ${\mathbf{ldxxyn}}=\u27e8\mathit{\text{value}}\u27e9$ and ${\mathbf{nnv}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: ${\mathbf{ldxxyn}}\ge {\mathbf{nnv}}$.
${\mathbf{ifail}}=5$
On entry, $i=\u27e8\mathit{\text{value}}\u27e9$ and ${\mathbf{mt}}(4,i)=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: ${\mathbf{mt}}(4,i)=1$, $2$ or $3$.
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.
${\mathbf{ifail}}=-399$
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.
${\mathbf{ifail}}=-999$
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.
7Accuracy
The computations are believed to be stable.
8Parallelism and Performance
g13bgf is not threaded in any implementation.
9Further Comments
The time taken by g13bgf is approximately proportional to ${\mathbf{nnv}}\times {\mathbf{npara}}$.
10Example
This example uses the data described in g13bef in which $40$ observations of an output time series and a single input series were processed. In this example a model which included seasonal differencing of order $1$ was used. The $10$ values of the state set and the $5$ final values of para then obtained are used as input to this program, together with the values of $4$ new observations and the transfer function orders of the input series. The model used is ${\varphi}_{1}=0.5158$, ${\Theta}_{1}=0.9994$, ${\omega}_{0}=8.6343$, ${\delta}_{1}=0.6726$, $c=-0.3172$.
The following are computed and printed out: the updated state set, the residuals ${a}_{t}$ and the values of the components ${z}_{t}$ and the output noise component ${n}_{t}$ corresponding to the new observations.