g13acf calculates partial autocorrelation coefficients given a set of autocorrelation coefficients. It also calculates the predictor error variance ratios for increasing order of finite lag autoregressive predictor, and the autoregressive parameters associated with the predictor of maximum order.
The routine may be called by the names g13acf or nagf_tsa_uni_autocorr_part.
The data consist of values of autocorrelation coefficients , relating to lags . These will generally (but not necessarily) be sample values such as may be obtained from a time series using g13abf.
The partial autocorrelation coefficient at lag may be identified with the parameter in the autoregression
where is the predictor error.
The first subscript of and emphasizes the fact that the parameters will in general alter as further terms are introduced into the equation (i.e., as is increased).
The parameters are determined from the autocorrelation coefficients by the Yule–Walker equations
taking when , and .
The predictor error variance ratio is defined by
The above sets of equations are solved by a recursive method (the Durbin–Levinson algorithm). The recursive cycle applied for , where is the number of partial autocorrelation coefficients required, is initialized by setting and .
If the condition occurs, say when , it indicates that the supplied autocorrelation coefficients do not form a positive definite sequence (see Hannan (1960)), and the recursion is not continued. The autoregressive parameters are overwritten at each recursive step, so that upon completion the only available values are , for , or if the recursion has been prematurely halted.
Box G E P and Jenkins G M (1976) Time Series Analysis: Forecasting and Control (Revised Edition) Holden–Day
Durbin J (1960) The fitting of time series models Rev. Inst. Internat. Stat.28 233
Hannan E J (1960) Time Series Analysis Methuen
1: – Real (Kind=nag_wp) arrayInput
On entry: the autocorrelation coefficient relating to lag
, for .
2: – IntegerInput
On entry: , the number of lags. The lags range from to and do not include zero.
3: – IntegerInput
On entry: , the number of partial autocorrelation coefficients required.
4: – Real (Kind=nag_wp) arrayOutput
On exit: contains the partial autocorrelation coefficient at lag , , for .
5: – Real (Kind=nag_wp) arrayOutput
On exit: contains the predictor error variance ratio , for .
6: – Real (Kind=nag_wp) arrayOutput
On exit: the autoregressive parameters of maximum order, i.e.,
if , or if , for .
7: – IntegerOutput
On exit: the number of valid values in each of p, v and ar. Thus in the case of premature termination at iteration (see Section 3), nvl is returned as .
8: – 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, .
On entry, and .
On entry, .
On entry, the autocorrelation coefficient of lag has absolute value greater than or equal to .
The autocorrelation coefficients do not form a positive definite sequence. The number of valid values computed are returned in nvl (see Section 3 for more details).
An unexpected error has been triggered by this routine. Please
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.
The computations are believed to be stable.
8Parallelism and Performance
g13acf is not threaded in any implementation.
The time taken by g13acf is proportional to .
This example uses an input series of sample autocorrelation coefficients derived from the original series of sunspot numbers generated by the g13abf example program. The results show five values of each of the three output arrays: partial autocorrelation coefficients, predictor error variance ratios and autoregressive parameters. All of these were valid.