g13dk accepts a sequence of new observations in a multivariate time series and updates both the forecasts and the standard deviations of the forecast errors. A call to g13dj must be made prior to calling this method in order to calculate the elements of a reference vector together with a set of forecasts and their standard errors. On a successful exit from g13dk the reference vector is updated so that should future series values become available these forecasts may be updated by recalling g13dk.

Syntax

C#
public static void g13dk(
	int k,
	int lmax,
	int m,
	ref int mlast,
	double[,] z,
	double[] dnref,
	double[,] v,
	double[,] predz,
	double[,] sefz,
	out int ifail
)
Visual Basic
Public Shared Sub g13dk ( _
	k As Integer, _
	lmax As Integer, _
	m As Integer, _
	ByRef mlast As Integer, _
	z As Double(,), _
	dnref As Double(), _
	v As Double(,), _
	predz As Double(,), _
	sefz As Double(,), _
	<OutAttribute> ByRef ifail As Integer _
)
Visual C++
public:
static void g13dk(
	int k, 
	int lmax, 
	int m, 
	int% mlast, 
	array<double,2>^ z, 
	array<double>^ dnref, 
	array<double,2>^ v, 
	array<double,2>^ predz, 
	array<double,2>^ sefz, 
	[OutAttribute] int% ifail
)
F#
static member g13dk : 
        k : int * 
        lmax : int * 
        m : int * 
        mlast : int byref * 
        z : float[,] * 
        dnref : float[] * 
        v : float[,] * 
        predz : float[,] * 
        sefz : float[,] * 
        ifail : int byref -> unit 

Parameters

k
Type: System..::..Int32
On entry: k, the dimension of the multivariate time series.
Constraint: k1.
lmax
Type: System..::..Int32
On entry: the number, lmax, of forecasts requested in the call to g13dj.
Constraint: lmax2.
m
Type: System..::..Int32
On entry: m, the number of new observations available since the last call to either g13dj or g13dk. The number of new observations since the last call to g13dj is then m+mlast.
Constraint: 0<m<lmax-mlast.
mlast
Type: System..::..Int32%
On entry: on the first call to g13dk, since calling g13dj, mlast must be set to 0 to indicate that no new observations have yet been used to update the forecasts; on subsequent calls mlast must contain the value of mlast as output on the previous call to g13dk.
On exit: is incremented by m to indicate that mlast+m observations have now been used to update the forecasts since the last call to g13dj.
mlast must not be changed between calls to g13dk, unless a call to g13dj has been made between the calls in which case mlast should be reset to 0.
Constraint: 0mlast<lmax-m.
z
Type: array<System..::..Double,2>[,](,)[,][,]
An array of size [dim1, m]
Note: dim1 must satisfy the constraint: dim1k
On entry: z[i-1,j-1] must contain the value of zi,n+mlast+j, for i=1,2,,k and j=1,2,,m, and where n is the number of observations in the time series in the last call made to g13dj.
Constraint: if the transformation defined in tr in g13dj for the ith series is the log transformation, then z[i-1,j-1]>0.0, and if it is the square-root transformation, then z[i-1,j-1]0.0, for j=1,2,,m and i=1,2,,k.
dnref
Type: array<System..::..Double>[]()[][]
An array of size [lref]
On entry: must contain the first lmax-1×k×k+2×k×lmax+k elements of the reference vector as returned on a successful exit from g13dj (or a previous call to g13dk).
On exit: the elements of ref are updated. The first lmax-1×k×k elements store the ψ weights ψ1,ψ2,,ψlmax-1. The next k×lmax elements contain the forecasts of the transformed series and the next k×lmax elements contain the variances of the forecasts of the transformed variables; see g13dj. The last k elements are not updated.
v
Type: array<System..::..Double,2>[,](,)[,][,]
An array of size [dim1, m]
Note: dim1 must satisfy the constraint: dim1k
On exit: v[i-1,j-1] contains an estimate of the ith component of εn+mlast+j, for i=1,2,,k and j=1,2,,m.
predz
Type: array<System..::..Double,2>[,](,)[,][,]
An array of size [dim1, lmax]
Note: dim1 must satisfy the constraint: dim1k
On entry: nonupdated values are kept intact.
On exit: predz[i-1,j-1] contains the updated forecast of zi,n+j, for i=1,2,,k and j=mlast+m+1,,lmax.
The columns of predz corresponding to the new observations since the last call to either g13dj or g13dk are set equal to the corresponding columns of z.
sefz
Type: array<System..::..Double,2>[,](,)[,][,]
An array of size [dim1, lmax]
Note: dim1 must satisfy the constraint: dim1k
On entry: nonupdated values are kept intact.
On exit: sefz[i-1,j-1] contains an estimate of the standard error of the corresponding element of predz, for i=1,2,,k and j=mlast+m+1,,lmax.
The columns of sefz corresponding to the new observations since the last call to either g13dj or g13dk are set equal to zero.
ifail
Type: System..::..Int32%
On exit: ifail=0 unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).

Description

Let Zt=z1t,z2t,,zktT, for t=1,2,,n, denote a k-dimensional time series for which forecasts of Z^n+1,Z^n+2,,Z^n+lmax have been computed using g13dj. Given m further observations Zn+1,Zn+2,,Zn+m, where m<lmax, g13dk updates the forecasts of Zn+m+1,Zn+m+2,,Zn+lmax and their corresponding standard errors.
g13dk uses a multivariate version of the procedure described in Box and Jenkins (1976). The forecasts are updated using the ψ weights, computed in g13dj. If Zt* denotes the transformed value of Zt and Z^t*l denotes the forecast of Zt+l* from time t with a lead of l (that is the forecast of Zt+l* given observations Zt*,Zt-1*,), then
Z^t+1*l=τ+ψlεt+1+ψl+1εt+ψl+2εt-1+
and
Z^t*l+1=τ+ψl+1εt+ψl+2εt-1+
where τ is a constant vector of length k involving the differencing parameters and the mean vector μ. By subtraction we obtain
Z^t+1*l=Z^t*l+1+ψlεt+1.
Estimates of the residuals corresponding to the new observations are also computed as εn+l=Zn+l*-Z^n*l, for l=1,2,,m. These may be of use in checking that the new observations conform to the previously fitted model.
On a successful exit, the reference array is updated so that g13dk may be called again should future series values become available, see [Further Comments].
When a transformation has been used the forecasts and their standard errors are suitably modified to give results in terms of the original series Zt; see Granger and Newbold (1976).

References

Box G E P and Jenkins G M (1976) Time Series Analysis: Forecasting and Control (Revised Edition) Holden–Day
Granger C W J and Newbold P (1976) Forecasting transformed series J. Roy. Statist. Soc. Ser. B 38 189–203
Wei W W S (1990) Time Series Analysis: Univariate and Multivariate Methods Addison–Wesley

Error Indicators and Warnings

Errors or warnings detected by the method:
Some error messages may refer to parameters that are dropped from this interface (KMAX) In these cases, an error in another parameter has usually caused an incorrect value to be inferred.
ifail=1
On entry,k<1,
orlmax<2,
orm0,
ormlast+mlmax,
ormlast<0,
orlref<lmax-1×k×k+2×k×lmax+k.
ifail=2
On entry, some of the elements of the reference vector, ref, have been corrupted since the most recent call to g13dj (or g13dk).
ifail=3
On entry, one or more of the elements of z is invalid, for the transformation being used; that is you may be trying to log or square root a series, some of whose values are negative.
ifail=4
This is an unlikely exit. For one of the series, overflow will occur if the forecasts are updated. You should check whether the elements of ref have been corrupted.
ifail=-9000
An error occured, see message report.
ifail=-6000
Invalid Parameters value
ifail=-4000
Invalid dimension for array value
ifail=-8000
Negative dimension for array value
ifail=-6000
Invalid Parameters value

Accuracy

The matrix computations are believed to be stable.

Parallelism and Performance

None.

Further Comments

If a further m* observations, Zn+mlast+1,Zn+mlast+2,,Zn+mlast+m*, become available, then forecasts of Zn+mlast+m*+1,Zn+mlast+m*+2,,Zn+lmax may be updated by recalling g13dk with m=m*. Note that m and the contents of the array z are the only quantities which need updating; mlast is updated on exit from the previous call. On a successful exit, v contains estimates of εn+mlast+1,εn+mlast+2,,εn+mlast+m*; columns mlast+1,mlast+2,,mlast+m* of predz contain the new observed values Zn+mlast+1,Zn+mlast+2,,Zn+mlast+m* and columns mlast+1,mlast+2,,mlast+m* of sefz are set to zero.

Example

See Also