naginterfaces.library.tsa.multi_​autocorr_​part

naginterfaces.library.tsa.multi_autocorr_part(c0, c, nk)[source]

multi_autocorr_part calculates the multivariate partial autocorrelation function of a multivariate time series.

For full information please refer to the NAG Library document for g13db

https://www.nag.com/numeric/nl/nagdoc_29.3/flhtml/g13/g13dbf.html

Parameters
c0float, array-like, shape

Contains the zero lag cross-covariances between the series as returned by multi_corrmat_cross(). ( is assumed to be symmetric, upper triangle only is used.)

cfloat, array-like, shape

Contains the cross-covariances at lags to . must contain the cross-covariance, , of series and series at lag . Series leads series .

nkint

The number of lags to which partial auto-correlations are to be calculated.

Returns
pfloat, ndarray, shape

The multiple squared partial autocorrelations from lags to ; that is, contains , for . For lags to the elements of are set to zero.

v0float

The lag zero prediction error variance (equal to the determinant of ).

vfloat, ndarray, shape

The prediction error variance ratios from lags to ; that is, contains , for . For lags to the elements of are set to zero.

dfloat, ndarray, shape

The prediction error variance matrices at lags to .

Element of contains the prediction error covariance of series and series at lag , for .

Series leads series ; that is, the th element of .

For lags to the elements of are set to zero.

dbfloat, ndarray, shape

The backward prediction error variance matrix at lag .

contains the backward prediction error covariance of series and series ; that is, the th element of the , where .

wfloat, ndarray, shape

The prediction coefficient matrices at lags to .

contains the th prediction coefficient of series at lag ; that is, the th element of , where , for .

For lags to the elements of are set to zero.

wbfloat, ndarray, shape

The backward prediction coefficient matrices at lags to .

contains the th backward prediction coefficient of series at lag ; that is, the th element of , where , for .

For lags to the elements of are set to zero.

nvpint

The maximum lag, , for which calculation of , , , , and was successful. If the function completes successfully will equal .

Raises
NagValueError
(errno )

On entry, and .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, and .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

is not positive definite.

Warns
NagAlgorithmicWarning
(errno )

For , at lag , was found not to be positive definite.

Notes

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 multi_corrmat_cross().

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

then ,

from which

and

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) and (3) are needed.

Quantities useful in assessing the effectiveness of the prediction equation are generalized variance ratios

and multiple squared partial autocorrelations

References

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, Biometrika (50), 129–134