NAG Library Function Document
nag_tsa_multi_inp_update (g13bgc)
1 Purpose
nag_tsa_multi_inp_update (g13bgc) 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
nag_tsa_multi_inp_model_estim (g13bec) to estimate the relevant transfer function and ARIMA parameters. The supplied state set will originally have been produced by
nag_tsa_multi_inp_model_estim (g13bec) (or possibly
nag_tsa_multi_inp_model_forecast (g13bjc)), but may since have been updated by nag_tsa_multi_inp_update (g13bgc).
2 Specification
#include <nag.h> |
#include <nagg13.h> |
void |
nag_tsa_multi_inp_update (Nag_ArimaOrder *arimav,
Integer nser,
Nag_TransfOrder *transfv,
const double para[],
Integer npara,
Integer nnv,
double xxyn[],
Integer tdxxyn,
Integer kzef,
Nag_G13_Opt *options,
NagError *fail) |
|
3 Description
The multi-input model is specified in
Section 3 in nag_tsa_multi_inp_model_estim (g13bec). 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 nag_tsa_multi_inp_model_estim (g13bec)) 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 function 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 function.
4 References
Box G E P and Jenkins G M (1976) Time Series Analysis: Forecasting and Control (Revised Edition) Holden–Day
5 Arguments
- 1:
arimav – Nag_ArimaOrder *
Pointer to structure of type Nag_ArimaOrder with the following members:
- p – Integer
- d – IntegerInput
- q – IntegerInput
- bigp – IntegerInput
- bigd – IntegerInput
- bigq – IntegerInput
- s – IntegerInput
-
On entry: these seven members of
arimav must specify the orders vector
, respectively, 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.
- 2:
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.
- 3:
transfv – Nag_TransfOrder *
Pointer to structure of type Nag_TransfOrder with the following members:
- b – Integer *Input
- q – Integer *Input
- p – Integer *
- r – Integer *Input
-
On entry: before use, these member pointers
must be allocated memory by calling
nag_tsa_transf_orders (g13byc) which allocates
elements to each pointer. The memory allocated to these pointers must be given the transfer function model orders
,
and
of each of the input series. The order arguments for input series
are held in the
th element of the allocated memory for each pointer.
holds the value
,
holds the value
and
holds the value
.
For a simple input, .
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.
When , any nonzero contents of the th element of the memory of , and are ignored.
Constraint:
,
or
, for
The memory allocated to the members of
transfv must be freed by a call to
nag_tsa_trans_free (g13bzc).
- 4:
para[npara] – const doubleInput
On entry: estimates of the multi-input model parameters as returned by
nag_tsa_multi_inp_model_estim (g13bec). 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
.
- 5:
npara – IntegerInput
On entry: the exact number of , , , , , and parameters. ( must be included whether its value was previously estimated or was set fixed.)
- 6:
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.
- 7:
xxyn[] – doubleInput/Output
-
Note: the th element of the matrix is stored in .
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.
- 8:
tdxxyn – IntegerInput
-
On entry: the stride separating matrix column elements in the array
xxyn.
Constraint:
.
- 9:
kzef – IntegerInput
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.
- 10:
options – Nag_G13_Opt *Input/Output
On entry: a pointer to a structure of type Nag_G13_Opt as returned by
nag_tsa_cross_corr (g13bcc) or
nag_tsa_multi_inp_model_forecast (g13bjc).
On exit: the structure contains the updated state space information.
- 11:
fail – NagError *Input/Output
-
The NAG error argument (see
Section 3.6 in the Essential Introduction).
6 Error Indicators and Warnings
- NE_ALLOC_FAIL
-
Dynamic memory allocation failed.
- NE_BAD_PARAM
-
On entry, argument had an illegal value.
- NE_INT
-
On entry, .
Constraint: .
- NE_INT_2
-
On entry, and .
Constraint: .
- NE_INTERNAL_ERROR
-
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact
NAG for assistance.
- NE_STRUCT_CORRUPT
-
Values of the members of structures
arimav,
transfv and
options are not compatible.
7 Accuracy
The computations are believed to be stable.
8 Parallelism and Performance
Not applicable.
The time taken by nag_tsa_multi_inp_update (g13bgc) is approximately proportional to .
10 Example
This example uses the data described in
nag_tsa_multi_inp_model_estim (g13bec) 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
Program Text (g13bgce.c)
10.2 Program Data
Program Data (g13bgce.d)
10.3 Program Results
Program Results (g13bgce.r)