nag_arma_time_series (g05hac) generates an autoregressive moving average (ARMA) time series with Normally distributed errors (or residuals). It initializes the series to a stationary position and sets up a reference vector enabling the function to be called repeatedly, adding terms to the previous series at each call.
An ARMA model, denoted by ARMA
, is a mixture of an autoregressive process of order
(AR) and a moving average (MA) process of order
and can be written as
where
are the realization of the series,
is the mean of the series and
are the errors (or residuals, also often called the white noise) which are independently distributed as normal with mean zero and variance
. The arguments
are the autoregressive arguments and the arguments
are the moving average arguments.
The function sets up initial values corresponding to a stationary position using the method described by
Tunnicliffe–Wilson (1979). It generates
terms of the time series by first calculating the next term in the autoregressive series and then applying the moving-average summation and storing the result.
Tunnicliffe–Wilson G (1979) Some efficient computational procedures for high order ARMA models J. Statist. Comput. Simulation 8 301–309
- 1:
start – Nag_BooleanInput
-
On entry:
start must be Nag_TRUE if a new series is to begin, if
start is Nag_FALSE a previously generated series will be continued. If start is Nag_FALSE then the scalar arguments
p,
q,
mean and
vara and the contents of the array arguments,
phi and
theta must not be changed.
- 2:
p – IntegerInput
-
On entry: the number of autoregressive coefficients supplied.
Constraint:
.
- 3:
q – IntegerInput
-
On entry: the number of moving-average coefficients supplied.
Constraint:
.
- 4:
phi[p] – const doubleInput
-
On entry: the autoregressive coefficients of the model, if any, must contain , for .
- 5:
theta[q] – const doubleInput
-
On entry: the moving-average coefficients of the model, if any, must contain , for .
- 6:
mean – doubleInput
-
On entry: the mean of the time series.
- 7:
vara – doubleInput
-
On entry: the variance of the errors, .
Constraint:
.
- 8:
n – IntegerInput
-
On entry: the number of observations to be generated.
Constraint:
.
- 9:
w[n] – doubleOutput
-
On exit: the realization of the time series.
- 10:
ref[] – doubleOutput
-
On exit: the reference vector and the recent history of the series.
- 11:
fail – NagError *Input/Output
-
The NAG error argument (see
Section 3.6 in the Essential Introduction).
Not applicable.
None.
The program below shows two calls of nag_arma_time_series (g05hac). In the first call an ARMA series is generated. In the second call terms are added to the already existing series.
None.