naginterfaces.library.tsa.multi_regmat_partial¶
- naginterfaces.library.tsa.multi_regmat_partial(z, m)[source]¶
multi_regmat_partial
calculates the sample partial autoregression matrices of a multivariate time series. A set of likelihood ratio statistics and their significance levels are also returned. These quantities are useful for determining whether the series follows an autoregressive model and, if so, of what order.For full information please refer to the NAG Library document for g13dp
https://support.nag.com/numeric/nl/nagdoc_30.3/flhtml/g13/g13dpf.html
- Parameters
- zfloat, array-like, shape
must contain the observation , for , for .
- mint
, the number of partial autoregression matrices to be computed. If in doubt set .
- Returns
- maxlagint
The maximum lag up to which partial autoregression matrices (along with their likelihood ratio statistics and their significance levels) have been successfully computed. On a successful exit will equal . If = 2 on exit then will be less than .
- parlagfloat, ndarray, shape
contains an estimate of the th element of the partial autoregression matrix at lag , , for , and .
- sefloat, ndarray, shape
contains an estimate of the standard error of the corresponding element in the array .
- qqfloat, ndarray, shape
contains an estimate of the th element of the corresponding variance-covariance matrix , for , for , for .
- xfloat, ndarray, shape
contains , the likelihood ratio statistic at lag , for .
- pvaluefloat, ndarray, shape
contains the significance level of the statistic in the corresponding element of .
- loglhdfloat, ndarray, shape
contains an estimate of the maximum of the log-likelihood function when an model has been fitted to the series, for .
- Raises
- NagValueError
- (errno )
On entry, , and .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- Warns
- NagAlgorithmicWarning
- (errno )
The recursive equations used to compute the partial autoregression matrices are ill-conditioned. They have been computed up to lag .
- Notes
Let , for , denote a vector of time series. The partial autoregression matrix at lag , , is defined to be the last matrix coefficient when a vector autoregressive model of order is fitted to the series. has the property that if follows a vector autoregressive model of order then for .
Sample estimates of the partial autoregression matrices may be obtained by fitting autoregressive models of successively higher orders by multivariate least squares; see Tiao and Box (1981) and Wei (1990). These models are fitted using a algorithm based on the functions
correg.linregm_obs_edit
andcorreg.linregm_var_del
. They are calculated up to lag , which is usually taken to be at most .The function also returns the asymptotic standard errors of the elements of and an estimate of the residual variance-covariance matrix , for . If denotes the residual sum of squares and cross-products matrix after fitting an model to the series then under the null hypothesis the test statistic
is asymptotically distributed as with degrees of freedom. provides a useful diagnostic aid in determining the order of an autoregressive model. (Note that .) The function also returns an estimate of the maximum of the log-likelihood function for each AR model that has been fitted.
- References
Tiao, G C and Box, G E P, 1981, Modelling multiple time series with applications, J. Am. Stat. Assoc. (76), 802–816
Wei, W W S, 1990, Time Series Analysis: Univariate and Multivariate Methods, Addison–Wesley