PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_tsa_multi_inputmod_update (g13bg)
Purpose
nag_tsa_multi_inputmod_update (g13bg) 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_inputmod_estim (g13be) to estimate the relevant transfer function and ARIMA parameters. The supplied state set will originally have been produced by
nag_tsa_multi_inputmod_estim (g13be) (or possibly
nag_tsa_multi_inputmod_forecast (g13bj)), but may since have been updated by
nag_tsa_multi_inputmod_update (g13bg).
Syntax
[
sttf,
xxyn,
res,
ifail] = g13bg(
sttf,
mr,
mt,
para,
xxyn,
kzef, 'nsttf',
nsttf, 'nser',
nser, 'npara',
npara, 'nnv',
nnv)
[
sttf,
xxyn,
res,
ifail] = nag_tsa_multi_inputmod_update(
sttf,
mr,
mt,
para,
xxyn,
kzef, 'nsttf',
nsttf, 'nser',
nser, 'npara',
npara, 'nnv',
nnv)
Note: the interface to this routine has changed since earlier releases of the toolbox:
At Mark 22: |
nnv was made optional |
Description
The multi-input model is specified in
Description in
nag_tsa_multi_inputmod_estim (g13be). 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
Description in
nag_tsa_multi_inputmod_estim (g13be)) 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.
References
Box G E P and Jenkins G M (1976) Time Series Analysis: Forecasting and Control (Revised Edition) Holden–Day
Parameters
Compulsory Input Parameters
- 1:
– double array
-
The
nsttf values in the state set before updating as returned by
nag_tsa_multi_inputmod_estim (g13be) or
nag_tsa_multi_inputmod_forecast (g13bj), or a previous call to
nag_tsa_multi_inputmod_update (g13bg).
- 2:
– int64int32nag_int array
-
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 , .
- 3:
– int64int32nag_int array
-
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 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 nag_tsa_multi_inputmod_update (g13bg).
Constraint:
, or , for .
- 4:
– double array
-
Estimates of the multi-input model parameters as returned by
nag_tsa_multi_inputmod_estim (g13be). 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:
– double array
-
ldxxyn, the first dimension of the array, must satisfy the constraint
.
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.
- 6:
– int64int32nag_int scalar
-
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.
Optional Input Parameters
- 1:
– int64int32nag_int scalar
-
Default:
the dimension of the array
sttf.
- 2:
– int64int32nag_int scalar
-
Default:
the dimension of the array
mt and the second dimension of the array
xxyn. (An error is raised if these dimensions are not equal.)
The total number of input and output series. There may be any number of input series (including none), but only one output series.
- 3:
– int64int32nag_int scalar
-
Default:
the dimension of the array
para.
The exact number of , , , , , and parameters. ( must be included whether its value was previously estimated or was set fixed.)
- 4:
– int64int32nag_int scalar
-
Default:
the first dimension of the array
xxyn.
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.
Output Parameters
- 1:
– double array
-
The state set values after updating.
- 2:
– double array
-
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.
- 3:
– double array
-
The values of the residual series corresponding to the new observations of the output series.
- 4:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
Errors or warnings detected by the function:
-
-
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, | ldxxyn is too small. |
-
-
On entry, | iwa is too small. |
-
-
On entry, one of the , stored in , for does not equal , or .
-
An unexpected error has been triggered by this routine. Please
contact
NAG.
-
Your licence key may have expired or may not have been installed correctly.
-
Dynamic memory allocation failed.
Accuracy
The computations are believed to be stable.
Further Comments
The time taken by nag_tsa_multi_inputmod_update (g13bg) is approximately proportional to .
Example
This example uses the data described in
nag_tsa_multi_inputmod_estim (g13be) 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.
Open in the MATLAB editor:
g13bg_example
function g13bg_example
fprintf('g13bg example results\n\n');
sttf = [ 6.0530; 184.4749; -80.0885; -75.1704; -76.9481;
-81.4749; 0.7776; -2.6190; -2.3054; -1.1963];
mr = [int64(1);0;0;0;1;1;4];
mt = [int64(1),0;
0, 0;
1, 0;
3, 0];
para = [ 0.5158; 0.9994; 8.6343; 0.6726; -0.3172];
xxyn = [5.941, 96;
5.386, 95;
5.811, 80;
6.716, 88];
kzef = int64(1);
%Update state set with new observations
[sttf, xxyn, res, ifail] = ...
g13bg( ...
sttf, mr, mt, para, xxyn, kzef);
disp('The updated state set');
ns = numel(sttf);
for j = 1:6:ns
fprintf('%10.4f', sttf(j:min(j+5,ns)));
fprintf('\n');
end
fprintf('\nThe residuals (after differencing)\n');
fprintf('%4d%12.4f\n',[[1:numel(res)]; res']);
fprintf('\n z(t) n(t)\n');
disp(xxyn);
g13bg example results
The updated state set
6.7160 158.3155 -80.3412 -74.9035 -80.7814 -70.3155
0.8416 -2.0333 -5.8201 10.2810
The residuals (after differencing)
1 1.4586
2 -2.4674
3 -4.7714
4 13.2830
z(t) n(t)
176.3412 -80.3412
169.9035 -74.9035
160.7814 -80.7814
158.3155 -70.3155
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015