g13ac 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.
Syntax
C# |
---|
public static void g13ac( double[] r, int nk, int nl, double[] p, double[] v, double[] ar, out int nvl, out int ifail ) |
Visual Basic |
---|
Public Shared Sub g13ac ( _ r As Double(), _ nk As Integer, _ nl As Integer, _ p As Double(), _ v As Double(), _ ar As Double(), _ <OutAttribute> ByRef nvl As Integer, _ <OutAttribute> ByRef ifail As Integer _ ) |
Visual C++ |
---|
public: static void g13ac( array<double>^ r, int nk, int nl, array<double>^ p, array<double>^ v, array<double>^ ar, [OutAttribute] int% nvl, [OutAttribute] int% ifail ) |
F# |
---|
static member g13ac : r : float[] * nk : int * nl : int * p : float[] * v : float[] * ar : float[] * nvl : int byref * ifail : int byref -> unit |
Parameters
- r
- Type: array<System..::..Double>[]()[][]An array of size [nk]On entry: the autocorrelation coefficient relating to lag , for .
- nk
- Type: System..::..Int32On entry: , the number of lags. The lags range from to and do not include zero.Constraint: .
- nl
- Type: System..::..Int32On entry: , the number of partial autocorrelation coefficients required.Constraint: .
- p
- Type: array<System..::..Double>[]()[][]An array of size [nl]On exit: contains the partial autocorrelation coefficient at lag , , for .
- v
- Type: array<System..::..Double>[]()[][]An array of size [nl]On exit: contains the predictor error variance ratio , for .
- ar
- Type: array<System..::..Double>[]()[][]An array of size [nl]On exit: the autoregressive parameters of maximum order, i.e., if , or if , for .
- nvl
- Type: System..::..Int32%On exit: the number of valid values in each of p, v and ar. Thus in the case of premature termination at iteration (see [Description]), nvl is returned as .
- ifail
- Type: System..::..Int32%On exit: unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).
Description
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 g13ab.
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 .
Then
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.
References
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
Error Indicators and Warnings
Errors or warnings detected by the method:
On entry, , or , or .
- On entry, the autocorrelation coefficient of lag has an absolute value greater than or equal to ; no recursions could be performed.
- Recursion has been prematurely terminated; the supplied autocorrelation coefficients do not form a positive definite sequence (see [Description]). Parameter nvl returns the number of valid values computed.
Accuracy
The computations are believed to be stable.
Parallelism and Performance
None.
Further Comments
The time taken by g13ac is proportional to .