NAG Library Function Document
nag_tsa_auto_corr_part (g13acc) 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.
||nag_tsa_auto_corr_part (const double r,
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 nag_tsa_auto_corr (g13abc)
The partial autocorrelation coefficient at lag
may be identified with the parameter
in the autoregression
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
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
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
r[nk] – const doubleInput
On entry: the autocorrelation coefficient relating to lag , for .
nk – IntegerInput
, the number of lags. The lags range from to and do not include zero.
nl – IntegerInput
, the number of partial autocorrelation coefficients required.
p[nl] – doubleOutput
On exit: contains the partial autocorrelation coefficient at lag , , for .
v[nl] – doubleOutput
On exit: contains the predictor error variance ratio , for .
ar[nl] – doubleOutput
: the autoregressive parameters of maximum order, i.e.,
nvl – Integer *Output
: the number of valid values in each of p
. Thus in the case of premature termination at iteration
(see Section 3
is returned as
fail – NagError *Input/Output
The NAG error argument (see Section 3.6
in the Essential Introduction).
6 Error Indicators and Warnings
On entry, while . These parameters must satisfy .
Recursion has been prematurely terminated; the supplied autocorrelation coefficients do not form a positive definite sequence. Argument nvl
returns the number of valid values computed.
On entry, .
On entry, .
On entry, the autocorrelation coefficient of lag 1 has an absolute value greater than or equal to 1.0; no recursions could be performed.
The computations are believed to be stable.
The time taken by nag_tsa_auto_corr_part (g13acc) is proportional to .
This example uses an input series of
sample autocorrelation coefficients derived from the original series of sunspot numbers generated by the nag_tsa_auto_corr (g13abc)
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.
9.1 Program Text
Program Text (g13acce.c)
9.2 Program Data
Program Data (g13acce.d)
9.3 Program Results
Program Results (g13acce.r)