The function may be called by the names: g13dbc, nag_tsa_multi_autocorr_part or nag_tsa_multi_auto_corr_part.
3Description
The input is a set of lagged autocovariance matrices . These will generally be sample values such as are obtained from a multivariate time series using g13dmc.
The main calculation is the recursive determination of the coefficients in the finite lag (forward) prediction equation
and the associated backward prediction equation
together with the covariance matrices of and of .
The recursive cycle, by which the order of the prediction equation is extended from to , is to calculate
(1)
then ,
from which
(2)
and
(3)
Finally, and .
(Here denotes the transpose of a matrix.)
The cycle is initialized by taking (for )
In the step from to , the above equations contain redundant terms and simplify. Thus (1) becomes and neither (2) or (3) are needed.
Quantities useful in assessing the effectiveness of the prediction equation are generalized variance ratios
and multiple squared partial autocorrelations
4References
Akaike H (1971) Autoregressive model fitting for control Ann. Inst. Statist. Math.23 163–180
Whittle P (1963) On the fitting of multivariate autoregressions and the approximate canonical factorization of a spectral density matrix Biometrika50 129–134
5Arguments
1: – const doubleInput
On entry: contains the zero lag cross-covariances between the ns series as returned by g13dmc. (c0 is assumed to be symmetric, upper triangle only is used.)
2: – const doubleInput
On entry: the cross-covariances as returned by g13dmc.
3: – IntegerInput
On entry: , the number of time series whose cross-covariances are supplied in c and c0.
Constraint:
.
4: – IntegerInput
On entry: , the maximum lag for which cross-covariances are supplied in c.
Constraint:
.
5: – IntegerInput
On entry: the number of lags to which partial auto-correlations are to be calculated.
Constraint:
.
6: – doubleOutput
On exit: the multiple squared partial autocorrelations from lags to nvp; that is, contains
, for . For lags to nk the elements of p are set to zero.
7: – double *Output
On exit: the lag zero prediction error variance (equal to the determinant of c0).
8: – doubleOutput
On exit: the prediction error variance ratios from lags to nvp; that is,
contains , for . For lags to nk the elements of v are set to zero.
9: – doubleOutput
On exit: the prediction error variance matrices at lags to nvp, contains the th prediction error covariance of series and series at lag . Series leads series .
10: – doubleOutput
On exit: the backward prediction error variance matrix at lag nvp, contains the backward prediction error covariance of series and series .
11: – doubleOutput
On exit: the prediction coefficient matrices at lags to nvp, contains the th prediction coefficient of series at lag (i.e., the th element of ).
12: – doubleOutput
On exit: the backward prediction coefficient matrices at lags to nvp, contains the th backward prediction coefficient of series at lag (i.e., the th element of ).
13: – Integer *Output
On exit: the maximum lag, , for which calculation of p, v, d, db, w and wb was successful. If the function completes successfully nvp will equal nk.
14: – NagError *Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).
6Error Indicators and Warnings
NE_ALLOC_FAIL
Dynamic memory allocation failed.
See Section 3.1.2 in the Introduction to the NAG Library CL Interface for further information.
NE_BAD_PARAM
On entry, argument had an illegal value.
NE_INT
On entry, .
Constraint: .
On entry, .
Constraint: .
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.
See Section 7.5 in the Introduction to the NAG Library CL Interface for further information.
NE_NO_LICENCE
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library CL Interface for further information.
NE_POS_DEF
c0 is not positive definite. The arguments v0, v, p, d, db, w, wb and nvp are set to zero.
For , at lag , was found not to be positive definite. Up to lag , arguments v0, v, p, d, w and wb contain the values calculated so far. From lag they contain zero. The argument db contains the backward prediction coefficients for lag .
7Accuracy
The conditioning of the problem depends on the prediction error variance ratios. Very small values of these may indicate loss of accuracy in the computations.
8Parallelism and Performance
Background information to multithreading can be found in the Multithreading documentation.
g13dbc is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
g13dbc makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this function. Please also consult the Users' Note for your implementation for any additional implementation-specific information.
9Further Comments
The time taken by g13dbc is roughly proportional to .
If sample autocorrelation matrices are used as input, then the output will be relevant to the original series scaled by their standard deviations. If these autocorrelation matrices are produced by g13dmc, you must replace the diagonal elements of (otherwise used to hold the series variances) by .
10Example
This example reads the autocovariance matrices for four series from lag to . It calls g13dbc to calculate the multivariate partial autocorrelation function and other related matrices of statistics up to lag . It prints the results.