PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_tsa_uni_arima_prelim (g13ad)
Purpose
nag_tsa_uni_arima_prelim (g13ad) calculates preliminary estimates of the parameters of an autoregressive integrated moving average (ARIMA) model from the autocorrelation function of the appropriately differenced times series.
Syntax
Description
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
Description in
nag_tsa_uni_arima_estim (g13ae) 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 .
References
Box G E P and Jenkins G M (1976) Time Series Analysis: Forecasting and Control (Revised Edition) Holden–Day
Parameters
Compulsory Input Parameters
- 1:
– int64int32nag_int array
-
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:
– double array
-
The autocorrelations (starting at lag ), which must have been calculated after the time series has been appropriately differenced.
Constraint:
, for .
- 3:
– double scalar
-
The series sample variance, calculated after appropriate differencing has been applied to the series.
Constraint:
.
- 4:
– int64int32nag_int scalar
-
The exact number of parameters specified in the model by array
mr.
Constraint:
.
Optional Input Parameters
- 1:
– int64int32nag_int scalar
-
Default:
the dimension of the array
r.
The maximum lag of the autocorrelations in array
r.
Constraint:
.
Output Parameters
- 1:
– double array
-
The first
npar elements of
par contain the preliminary estimates of the ARIMA model parameters, in standard order.
- 2:
– double scalar
-
An estimate of the residual variance of the preliminarily estimated model.
- 3:
– int64int32nag_int array
-
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. |
- 4:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
Errors or warnings detected by the function:
Cases prefixed with W are classified as warnings and
do not generate an error of type NAG:error_n. See nag_issue_warnings.
-
-
On entry, the orders vector
mr is invalid. One of the constraints in
Arguments has been violated.
-
-
On entry, . There are not enough autocorrelations to enable the required model to be estimated.
-
-
On entry, | at least one element of r lies outside the range . |
-
-
-
-
-
-
On entry, | the workspace array wa is too small. See Arguments for the minimum size formula. |
- W
-
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 be estimated.
-
An unexpected error has been triggered by this routine. Please
contact
NAG.
-
Your licence key may have expired or may not have been installed correctly.
-
Dynamic memory allocation failed.
Accuracy
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.
Further Comments
The time taken by nag_tsa_uni_arima_prelim (g13ad) is approximately proportional to
Example
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
nag_tsa_uni_arima_prelim (g13ad).
Open in the MATLAB editor:
g13ad_example
function g13ad_example
fprintf('g13ad example results\n\n');
r = [-0.32804; 0.09850; -0.21854; 0.05585; 0.04679;
0.04135; -0.07989; 0.00335; 0.13973; -0.04022;
0.07618; -0.40583; 0.18239; -0.05057; 0.16094;
-0.15900; 0.09152; -0.03474; 0.05195; -0.14417;
0.04264; -0.08170; 0.23389; -0.02828; -0.09001;
0.03050; -0.02046; 0.05522; -0.02048; -0.06651;
-0.02940; 0.20204; -0.13953; 0.10098; -0.20849;
0.03338; 0.00829; 0.07082; -0.04457; -0.01216];
mr = [int64(0);1;1;0;1;1;12];
xv = 0.00213;
npar = int64(2);
[par, rv, isf, ifail] = g13ad( ...
mr, r, xv, npar);
fprintf('Parameter estimation success/failure indicator');
fprintf('%4d', isf);
fprintf('\n\nARIMA model parameter values ');
fprintf('%10.5f', par);
fprintf('\n\nResidual variance %10.5f\n', rv);
g13ad example results
Parameter estimation success/failure indicator 0 1 0 1
ARIMA model parameter values 0.37390 0.51237
Residual variance 0.00148
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015