g13dpf 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.
The routine may be called by the names g13dpf or nagf_tsa_multi_regmat_partial.
3Description
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 routines g02dcfandg02dff. They are calculated up to lag , which is usually taken to be at most .
The routine 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 routine also returns an estimate of the maximum of the log-likelihood function for each AR model that has been fitted.
4References
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
5Arguments
1: – IntegerInput
On entry: , the number of time series.
Constraint:
.
2: – IntegerInput
On entry: , the number of observations in the time series.
Constraint:
.
3: – Real (Kind=nag_wp) arrayInput
On entry: must contain the observation , for and .
4: – IntegerInput
On entry: the first dimension of the arrays z, parlag, se and qq and the second dimension of the arrays parlag, se and qq as declared in the (sub)program from which g13dpf is called.
Constraint:
.
5: – IntegerInput
On entry: , the number of partial autoregression matrices to be computed. If in doubt set .
Constraint:
and .
6: – IntegerOutput
On exit: 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 maxlag will equal m. If on exit then maxlag will be less than m.
7: – Real (Kind=nag_wp) arrayOutput
On exit: contains an estimate of the th element of the partial autoregression matrix at lag , , for , and .
8: – Real (Kind=nag_wp) arrayOutput
On exit: contains an estimate of the standard error of the corresponding element in the array parlag.
9: – Real (Kind=nag_wp) arrayOutput
On exit: contains an estimate of the th element of the corresponding variance-covariance matrix , for , and .
10: – Real (Kind=nag_wp) arrayOutput
On exit: contains , the likelihood ratio statistic at lag , for .
11: – Real (Kind=nag_wp) arrayOutput
On exit: contains the significance level of the statistic in the corresponding element of x.
12: – Real (Kind=nag_wp) arrayOutput
On exit: contains an estimate of the maximum of the log-likelihood function when an model has been fitted to the series, for .
13: – Real (Kind=nag_wp) arrayWorkspace
14: – IntegerInput
On entry: the dimension of the array work as declared in the (sub)program from which g13dpf is called.
Constraint:
, where .
15: – Integer arrayWorkspace
16: – IntegerInput/Output
On entry: ifail must be set to , or to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of means that an error message is printed while a value of means that it is not.
If halting is not appropriate, the value or is recommended. If message printing is undesirable, then the value is recommended. Otherwise, the value is recommended. When the value or is used it is essential to test the value of ifail on exit.
On exit: unless the routine detects an error or a warning has been flagged (see Section 6).
6Error Indicators and Warnings
If on entry or , explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
On entry, , and .
Constraint: .
On entry, .
Constraint: .
On entry, and .
Constraint: .
On entry, and the minimum size .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
The recursive equations used to compute the partial autoregression matrices are ill-conditioned. They have been computed up to lag . All output quantities in the arrays parlag, se, qq, x, pvalue and loglhd up to and including lag maxlag will be correct. For your settings of and the value returned in maxlag is the largest permissible value of for which the model is not overparameterised.
An unexpected error has been triggered by this routine. Please
contact NAG.
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.
7Accuracy
The computations are believed to be stable.
8Parallelism and Performance
Background information to multithreading can be found in the Multithreading documentation.
g13dpf is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
g13dpf 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 routine. Please also consult the Users' Note for your implementation for any additional implementation-specific information.
9Further Comments
The time taken is roughly proportional to .
For each order of autoregressive model that has been estimated, g13dpf returns the maximum of the log-likelihood function. An alternative means of choosing the order of a vector AR process is to choose the order for which Akaike's information criterion is smallest. That is, choose the value of for which is smallest. You should be warned that this does not always lead to the same choice of as indicated by the sample partial autoregression matrices and the likelihood ratio statistics.
10Example
This example computes the sample partial autoregression matrices of two time series of length up to lag .