hide long namesshow long names
hide short namesshow short names
Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

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:
Mark 22: nnv has been made optional
.

Description

The multi-input model is specified in Section [Description] in (g13be). The form of these equations required to update the state set is as follows:
zt = δ1zt1 + δ2zt2 + + δpztp + ω0xtbω1xtb1ωqxtbq
zt=δ1zt-1+δ2zt-2++δpzt-p+ω0xt-b-ω1xt-b-1--ωqxt-b-q
the transfer models which generate input component values zi,tzi,t from one or more inputs xi,txi,t,
nt = ytz1,tz2,tzm,t
nt=yt-z1,t-z2,t--zm,t
which generates the output noise component from the output ytyt and the input components, and
wt = dsDntc
et = wtΦ1wtsΦ2wt2 × sΦPwtP × s + Θ1ets + Θ2et2 × s + + ΘQetQ × s
at = etφ1et1φ2et2φpetp + θ1at1 + θ2at2 + + θqatq
wt =dsDnt-c et =wt-Φ1wt-s-Φ2wt-2×s--ΦPwt-P×s+Θ1et-s+Θ2et-2×s++ΘQet-Q×s at =et-ϕ1et-1-ϕ2et-2--ϕpet-p+θ1at-1+θ2at-2++θqat-q
the ARIMA model for the output noise which generates the residuals atat.
The state set (as also given in Section [Description] in (g13be)) is the collection of terms
zn + 1k,xn + 1k,nn + 1k,wn + 1k,en + 1k  and  an + 1k
zn+1-k,xn+1-k,nn+1-k,wn+1-k,en+1-k  and  an+1-k
for k = 1k=1 up to the maximum lag associated with each of these series respectively, in the above model equations. nn is the latest time point of the series from which the state set has been generated.
The function accepts further values of the series ytyt, x1,t,x2,t,,xm,tx1,t,x2,t,,xm,t, for t = n + 1,,n + lt=n+1,,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 + ln+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 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:     sttf(nsttf) – 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:     mr(77) – int64int32nag_int array
The orders vector (p,d,q,P,D,Q,s)(p,d,q,P,D,Q,s) of the ARIMA model for the output noise component.
pp, qq, PP and QQ refer respectively to the number of autoregressive (φ)(ϕ), moving average (θ)(θ), seasonal autoregressive (Φ)(Φ) and seasonal moving average (Θ)(Θ) parameters.
dd, DD and ss refer respectively to the order of non-seasonal differencing, the order of seasonal differencing, and the seasonal period.
Constraints:
  • pp, dd, qq, PP, DD, QQ, s0s0;
  • p + q + P + Q > 0p+q+P+Q>0;
  • s1s1;
  • if s = 0s=0, P + D + Q = 0P+D+Q=0;
  • if s > 1s>1, P + D + Q > 0P+D+Q>0.
3:     mt(44,nser) – int64int32nag_int array
The transfer function model orders bb, pp and qq of each of the input series. The data for input series ii are held in column ii. Row 1 holds the value bibi, row 2 holds the value qiqi and row 3 holds the value pipi. For a simple input, bi = qi = pi = 0bi=qi=pi=0.
Row 4 holds the value riri, where ri = 1ri=1 for a simple input and ri = 2​ or ​3ri=2​ or ​3 for a transfer function input. When ri = 1ri=1 any nonzero contents of rows 1, 2 and 3 of column ii are ignored. The choice of ri = 2ri=2 or ri = 3ri=3 is an option for use in model estimation and does not affect the operation of nag_tsa_multi_inputmod_update (g13bg).
Constraint: mt(4,i) = 1mt4i=1, 22 or 33, for i = 1,2,,nser1i=1,2,,nser-1.
4:     para(npara) – 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: pp values of φϕ parameters, qq values of θθ parameters, PP values of ΦΦ parameters and QQ values of ΘΘ parameters. These are followed by the transfer function model parameter values ω0,ω1,,ωq1ω0,ω1,,ωq1, δ1,δ2,,δp1δ1,δ2,,δp1 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 cc.
5:     xxyn(ldxxyn,nser) – double array
ldxxyn, the first dimension of the array, must satisfy the constraint ldxxynnnvldxxynnnv.
The nnv new observation sets being used to update the state set. Column ii contains the values of input series ii, for i = 1,2,,nser1i=1,2,,nser-1. Column nsernser contains the values of the output series. Consecutive rows correspond to increasing time sequence.
6:     kzef – int64int32nag_int scalar
Must not be set to 00, if the values of the input component series ztzt and the values of the output noise component ntnt are to overwrite the contents of xxyn on exit, and must be set to 00 if xxyn is to remain unchanged on exit.

Optional Input Parameters

1:     nsttf – int64int32nag_int scalar
Default: The dimension of the array sttf.
The exact number of values in the state set array sttf as returned by nag_tsa_multi_inputmod_estim (g13be) or nag_tsa_multi_inputmod_forecast (g13bj).
2:     nser – 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:     npara – int64int32nag_int scalar
Default: The dimension of the array para.
The exact number of φϕ, θθ, ΦΦ, ΘΘ, ωω, δδ and cc parameters. (cc must be included whether its value was previously estimated or was set fixed.)
4:     nnv – 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.

Input Parameters Omitted from the MATLAB Interface

ldxxyn wa iwa

Output Parameters

1:     sttf(nsttf) – double array
The state set values after updating.
2:     xxyn(ldxxyn,nser) – double array
ldxxynnnvldxxynnnv.
If kzef = 0kzef=0, xxyn remains unchanged.
If kzef0kzef0, the columns of xxyn hold the corresponding values of the input component series ztzt and the output noise component ntnt in that order.
3:     res(nnv) – double array
The values of the residual series atat corresponding to the new observations of the output series.
4:     ifail – int64int32nag_int scalar
ifail = 0ifail=0 unless the function detects an error (see [Error Indicators and Warnings]).

Error Indicators and Warnings

Errors or warnings detected by the function:
  ifail = 1ifail=1
On entry,nsttf is not consistent with the orders in arrays mr and mt.
  ifail = 2ifail=2
On entry,npara is not consistent with the orders in arrays mr and mt.
  ifail = 3ifail=3
On entry,ldxxyn is too small.
  ifail = 4ifail=4
On entry,iwa is too small.
  ifail = 5ifail=5
On entry, one of the riri, stored in mt(4,i)mt4i, for i = 1,2,,nser1i=1,2,,nser-1 does not equal 11, 22 or 33.

Accuracy

The computations are believed to be stable.

Further Comments

The time taken by nag_tsa_multi_inputmod_update (g13bg) is approximately proportional to nnv × nparannv×npara.

Example

function nag_tsa_multi_inputmod_update_example
sttf = [6.053;
     184.4749;
     -80.0885;
     -75.1704;
     -76.9481;
     -81.4749;
     0.7776;
     -2.619;
     -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);
[sttfOut, xxynOut, res, ifail] = nag_tsa_multi_inputmod_update(sttf, mr, mt, para, xxyn, kzef)
 

sttfOut =

    6.7160
  158.3155
  -80.3412
  -74.9035
  -80.7814
  -70.3155
    0.8416
   -2.0333
   -5.8201
   10.2810


xxynOut =

  176.3412  -80.3412
  169.9035  -74.9035
  160.7814  -80.7814
  158.3155  -70.3155


res =

    1.4586
   -2.4674
   -4.7714
   13.2830


ifail =

                    0


function g13bg_example
sttf = [6.053;
     184.4749;
     -80.0885;
     -75.1704;
     -76.9481;
     -81.4749;
     0.7776;
     -2.619;
     -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);
[sttfOut, xxynOut, res, ifail] = g13bg(sttf, mr, mt, para, xxyn, kzef)
 

sttfOut =

    6.7160
  158.3155
  -80.3412
  -74.9035
  -80.7814
  -70.3155
    0.8416
   -2.0333
   -5.8201
   10.2810


xxynOut =

  176.3412  -80.3412
  169.9035  -74.9035
  160.7814  -80.7814
  158.3155  -70.3155


res =

    1.4586
   -2.4674
   -4.7714
   13.2830


ifail =

                    0



PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2013