g13adf calculates preliminary estimates of the parameters of an autoregressive integrated moving average (ARIMA) model from the autocorrelation function of the appropriately differenced times series.
The routine may be called by the names g13adf or nagf_tsa_uni_arima_prelim.
3Description
Preliminary estimates of the non-seasonal autoregressive parameters and the non-seasonal moving average parameters may be obtained from the sample autocorrelations relating to lags to , i.e., , of the differenced , where is assumed to follow a (possibly) seasonal ARIMA model (see Section 3 in g13aef for the specification of an ARIMA model).
Taking and , the , for are the solutions to the equations
The , for , are obtained from the solutions to the equations
(Cramer Wold-factorization), by setting
where are the ‘covariances’ modified in a two stage process by the autoregressive parameters.
Stage 1:
Stage 2:
The seasonal autoregressive parameters and the seasonal moving average parameters are estimated in the same way as the non-seasonal parameters, but each is replaced in the calculation by , where is the seasonal period.
An estimate of the residual variance is obtained by successively reducing the sample variance, first for non-seasonal, and then for seasonal, parameter estimates. If moving average parameters are estimated, the variance is reduced by a multiplying factor of , but otherwise by .
4References
Box G E P and Jenkins G M (1976) Time Series Analysis: Forecasting and Control (Revised Edition) Holden–Day
5Arguments
1: – Integer arrayInput
On entry: the orders vector of the ARIMA model whose parameters are to be estimated. , , and refer respectively to the number of autoregressive , moving average , seasonal autoregressive and seasonal moving average parameters. , and refer respectively to the order of non-seasonal differencing, the order of seasonal differencing and the seasonal period.
Constraints:
;
;
;
if , ;
if , .
2: – Real (Kind=nag_wp) arrayInput
On entry: the autocorrelations (starting at lag ), which must have been calculated after the time series has been appropriately differenced.
Constraint:
, for .
3: – IntegerInput
On entry: the maximum lag of the autocorrelations in array r.
Constraint:
.
4: – Real (Kind=nag_wp)Input
On entry: the series sample variance, calculated after appropriate differencing has been applied to the series.
Constraint:
.
5: – IntegerInput
On entry: the exact number of parameters specified in the model by array mr.
Constraint:
.
6: – Real (Kind=nag_wp) arrayWorkspace
7: – IntegerInput
On entry: the amount of workspace available.
Constraint:
if and and , .
8: – Real (Kind=nag_wp) arrayOutput
On exit: the first npar elements of par contain the preliminary estimates of the ARIMA model parameters, in standard order.
9: – Real (Kind=nag_wp)Output
On exit: an estimate of the residual variance of the preliminarily estimated model.
10: – Integer arrayOutput
On exit: contains success/failure indicators, one for each of the four types of parameter (autoregressive, moving average, seasonal autoregressive, seasonal moving average).
The indicator has the interpretation:
No parameter of this type is in the model.
Parameters of this type appear in the model and satisfactory preliminary estimates of this type were obtained.
Parameters of this type appear in the model but satisfactory preliminary estimates of this type were not obtainable. The estimates of this type of parameter were set to in array par.
11: – 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).
On entry, and the minimum size .
Constraint: , where and .
Satisfactory parameter estimates could not be obtained for all parameter types in the model. Inspect array isf for indicators of the parameter type(s) which could not estimated.
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 performance of the algorithm is conditioned by the roots of the autoregressive and moving average operators. If these are not close to unity in modulus, the errors, , should satisfy where is machine precision.
8Parallelism and Performance
Background information to multithreading can be found in the Multithreading documentation.
g13adf is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
g13adf 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 by g13adf is approximately proportional to
10Example
This example reads the sample autocorrelations to lag and the sample variance of the lagged and doubly differenced series of airline passenger totals (Box and Jenkins example series G (see Box and Jenkins (1976))). Preliminary estimates of the parameters of the model are obtained by a call to g13adf.