g13as is a diagnostic checking method suitable for use after fitting a Box–Jenkins ARMA model to a univariate time series using (G13AEF not in this release) g13af. The residual autocorrelation function is returned along with an estimate of its asymptotic standard errors and correlations. Also, g13as calculates the Box–Ljung portmanteau statistic and its significance level for testing model adequacy.
Public Shared Sub g13as ( _ n As Integer, _ v As Double(), _ mr As Integer(), _ m As Integer, _ par As Double(), _ ishow As Integer, _ r As Double(), _ rcm As Double(,), _ <OutAttribute> ByRef chi As Double, _ <OutAttribute> ByRef idf As Integer, _ <OutAttribute> ByRef siglev As Double, _ <OutAttribute> ByRef ifail As Integer _ )
public: static void g13as( int n, array<double>^ v, array<int>^ mr, int m, array<double>^ par, int ishow, array<double>^ r, array<double,2>^ rcm, [OutAttribute] double% chi, [OutAttribute] int% idf, [OutAttribute] double% siglev, [OutAttribute] int% ifail )
- Type: System..::..Int32On entry: , the number of observations in the residual series.If g13as is used following a call to (G13AEF not in this release), then n must be the value returned by (G13AEF not in this release).Constraint: .
- Type: array<System..::..Double>()An array of size [n]On entry: must contain an estimate of , for .If g13as is used following a call to (G13AEF not in this release) then the actual argument v must be as returned by (G13AEF not in this release).Constraint: must contain at least two distinct elements.
- Type: array<System..::..Int32>()An array of size On entry: the orders vector (, , , , , , ) as supplied to (G13AEF not in this release) g13af.Constraints:
- if , then and .
- Type: System..::..Int32On entry: the value of , the number of residual autocorrelations to be computed. See [Choice of ] for advice on the value of m.Constraint: .
- Type: array<System..::..Double>()An array of size [dim1]Note: dim1 must satisfy the constraint:On entry: the parameter estimates in the order , , , only.Constraint: the elements in par must satisfy the stationarity and invertibility conditions.
- Type: System..::..Int32
- Type: array<System..::..Double>()An array of size [m]On exit: an estimate of the residual autocorrelation coefficient at lag , for . If on exit then all elements of r are set to zero.
- Type: array<System..::..Double,2>[,](,)[,][,]An array of size [dim1, m]Note: dim1 must satisfy the constraint:
- Type: System..::..Double%On exit: the value of the portmanteau statistic, . If on exit then chi is returned as zero.
- Type: System..::..Double%
Consider the univariate multiplicative autoregressive-moving average model
where , for , denotes a time series and , for , is a residual series assumed to be normally distributed with zero mean and variance (). The 's are also assumed to be uncorrelated. Here is the overall mean term, is the seasonal period and is the backward shift operator such that . The polynomials in (1) are defined as follows:
is the non-seasonal autoregressive (AR) operator;
is the non-seasonal moving average (MA) operator;
is the seasonal AR operator; and
is the seasonal MA operator. The model (1) is assumed to be stationary, that is the zeros of and are assumed to lie outside the unit circle. The model (1) is also assumed to be invertible, that is the zeros of and are assumed to lie outside the unit circle. When both and are absent from the model, that is when , then the model is said to be non-seasonal.
The estimated residual autocorrelation coefficient at lag , , is computed as:
where denotes an estimate of the th residual, , and . A portmanteau statistic, , is calculated from the formula (see Box and Ljung (1978)):
where denotes the number of residual autocorrelations computed. (Advice on the choice of is given in [Choice of ].) Under the hypothesis of model adequacy, has an asymptotic -distribution on degrees of freedom. Let then the variance-covariance matrix of is given by:
The construction of the matrix is discussed in McLeod (1978). (Note that the mean, , and the residual variance, , play no part in calculating and therefore are not required as input to g13as.)
Box G E P and Ljung G M (1978) On a measure of lack of fit in time series models Biometrika 65 297–303
McLeod A I (1978) On the distribution of the residual autocorrelations in Box–Jenkins models J. Roy. Statist. Soc. Ser. B 40 296–302
Note: g13as may return useful information for one or more of the following detected errors or warnings.
Errors or warnings detected by the method:
Some error messages may refer to parameters that are dropped from this interface (NPAR, LDRCM) In these cases, an error in another parameter has usually caused an incorrect value to be inferred.
- On entry, the autoregressive (or moving average) parameters are extremely close to or outside the stationarity (or invertibility) region. To proceed, you must supply different parameter estimates in the array par.
- This is an unlikely exit brought about by an excessive number of iterations being needed to evaluate the zeros of the AR or MA polynomials. All output parameters are undefined.
- On entry, one or more of the AR operators has a factor in common with one or more of the MA operators. To proceed, this common factor must be deleted from the model. In this case, the off-diagonal elements of rcm are returned as zero and the diagonal elements set to . All other output quantities will be correct.
The computations are believed to be stable.
The time taken by g13as depends upon the number of residual autocorrelations to be computed, .
The number of residual autocorrelations to be computed, should be chosen to ensure that when the ARMA model (1) is written as either an infinite order autoregressive process:
or as an infinite order moving average process:
then the two sequences and are such that and are approximately zero for . An overestimate of is therefore preferable to an under-estimate of . In many instances the choice will suffice. In practice, to be on the safe side, you should try setting .
When or all the standard errors in rcm are set to . This is the asymptotic standard error of when all the autoregressive and moving average parameters are assumed to be known rather than estimated.
This example fits an ARIMA model to a series of observations. residual autocorrelations are computed.