|
NAG[g05hac] NAG[nag_arma_time_series] - ARMA time series of terms
|
|
Calling Sequence
g05hac(start, phi, theta, mean, vara, w, ref, 'p'=p, 'q'=q, 'n'=n, 'fail'=fail)
nag_arma_time_series(. . .)
Parameters
|
start - boolean;
|
|
|
On entry: start must be true if a new series is to begin, if start is false a previously generated series will be continued. If start is false then the scalar arguments p, q, mean and vara and the contents of the array arguments, phi and theta must not be changed.
|
|
|
phi - Vector(1..p, datatype=float[8]);
|
|
|
|
theta - Vector(1..q, datatype=float[8]);
|
|
|
|
mean - float;
|
|
|
On entry: the mean of the time series.
|
|
|
vara - float;
|
|
|
On entry: the variance of the errors, .
|
|
Constraint: . .
|
|
|
w - Vector(1..n, datatype=float[8]);
|
|
|
On exit: the realization of the time series.
|
|
|
ref - Vector(1.., datatype=float[8]);
|
|
|
Note: the dimension, dim, of the array ref must be at least .
|
|
On exit: the reference vector and the recent history of the series.
|
|
|
'p'=p - integer; (optional)
|
|
|
Default value: the first dimension of the array phi.
|
|
On entry: the number of autoregressive coefficients supplied.
|
|
Constraint: . .
|
|
|
'q'=q - integer; (optional)
|
|
|
Default value: the first dimension of the array theta.
|
|
On entry: the number of moving-average coefficients supplied.
|
|
Constraint: . .
|
|
|
'n'=n - integer; (optional)
|
|
|
Default value: the first dimension of the array w.
|
|
On entry: the number of observations to be generated.
|
|
Constraint: . .
|
|
|
'fail'=fail - table; (optional)
|
|
|
The NAG error argument, see the documentation for NagError.
|
|
|
|
Description
|
|
|
Purpose
|
|
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.
|
|
Error Indicators and Warnings
|
|
"NE_INT_ARG_LT"
On entry, p must not be less than 0: .
"NE_REAL_ARG_LE"
On entry, vara must not be less than or equal to 0.0: .
"NE_REF_VEC"
The reference vector set up by the previous call of this function has become corrupt.
"NE_START_P_Q"
The function has been called either with the first time or at least one of p or q has been changed in a subsequent call with .
"NE_STATIONARITY"
The input series does not constitute a stationary time-series model.
|
|
|
Examples
|
|
>
|
start := true:
p := 2:
q := 0:
mean := 0:
vara := 2:
n := 5:
phi := Vector([0.4, 0.2], datatype=float[8]):
theta := Vector([], datatype=float[8]):
w := Vector(5, datatype=float[8]):
ref := Vector(17, datatype=float[8]):
NAG:-g05cbc(0):
NAG:-g05hac(start, phi, theta, mean, vara, w, ref, 'p' = p, 'q' = q, 'n' = n):
|
|
|
See Also
|
|
Knuth D E (1981) The Art of Computer Programming (Volume 2) (2nd Edition) Addison–Wesley
Tunnicliffe–Wilson G (1979) Some efficient computational procedures for high order ARMA models J. Statist. Comput. Simulation 8 301–309
g05 Chapter Introduction.
NAG Toolbox Overview.
NAG Web Site.
|
|