nag_estimate_agarchII (g13fcc) estimates the arguments of a univariate regression-type II AGARCH process.
#include <nag.h> |
#include <nagg13.h> |
void |
nag_estimate_agarchII (const double yt[],
const double x[],
Integer tdx,
Integer num,
Integer p,
Integer q,
Integer nreg,
Integer mn,
double theta[],
double se[],
double sc[],
double covar[],
Integer tdc,
double *hp,
double et[],
double ht[],
double *lgf,
Nag_Garch_Stationary_Type stat_opt,
Nag_Garch_Est_Initial_Type est_opt,
Integer max_iter,
double tol,
NagError *fail) |
|
A univariate regression-type II AGARCH
process, with
coefficients
, for
,
, coefficients,
, for
, mean
, and
linear regression coefficients
, for
, can be represented by:
Here
is the number of terms in the sequence,
denotes the endogenous variables,
the exogenous variables,
the mean,
the regression coefficients,
the residuals,
the asymmetry argument,
the conditional variance, and
the information set of all information up to time
.
mn,
nreg can be used to simplify the GARCH
expression in equation
(1) as follows:
Note: if the
, where
is known (not to be estimated by nag_estimate_agarchII (g13fcc)) then equation
(1) can be written as
, where
. This corresponds to the case
No Regression or Mean, with
replaced by
.
Engle R (1982) Autoregressive conditional heteroskedasticity with estimates of the variance of United Kingdom inflation Econometrica 50 987–1008
- Note: for convenience npar will be used here to denote the expression representing the number of model parameters.
- 2:
yt[num] – const doubleInput
-
On entry: the sequence of observations, , for .
- 3:
x[] – const doubleInput
-
Note: the th element of the th vector is stored in .
On entry: row
of
x must contain the time dependent exogenous vector
, where
, for
.
- 4:
tdx – IntegerInput
-
On entry: the stride separating matrix column elements in the array
x.
Constraint:
.
- 5:
num – IntegerInput
On entry: the number of terms in the sequence, .
Constraint:
.
- 6:
p – IntegerInput
-
On entry: the GARCH argument .
Constraint:
.
- 7:
q – IntegerInput
-
On entry: the GARCH argument .
Constraint:
.
- 8:
nreg – IntegerInput
On entry: , the number of refression coefficients.
Constraint:
.
- 9:
mn – IntegerInput
-
On entry: if , the mean term will be included in the model.
Constraint:
or .
- 10:
theta[] – doubleInput/Output
-
On entry: the initial parameter estimates for the vector
.
The first element contains the coefficient
, the next
q elements contain the autoregressive coefficients
, for
.
The next
p elements are the moving average coefficients
, for
.
The next element contains the asymmetry argument .
If
, (when
) the next term contains an initial estimate of the mean term
and the remaining
nreg elements are taken as initial estimates of the linear regression coefficients
, for
.
On exit: the estimated values
for the vector
.
The first element contains the coefficient
, the next
q elements contain the coefficients
, for
.
The next
p elements are the coefficients
, for
.
The next element contains the estimate for the asymmetry parameter .
If , the next element contains an estimate for the mean term .
The final
nreg elements are the estimated linear regression coefficients
, for
.
- 11:
se[] – doubleOutput
-
On exit: the standard errors for
.
The first element contains the standard error for .
The next
q elements contain the standard errors for
, for
.
The next
p elements are the standard errors for
, for
.
The next element contains the standard error for .
If , the next element contains the standard error for .
The final
nreg elements are the standard errors for
, for
.
- 12:
sc[] – doubleOutput
-
On exit: the scores for
.
The first element contains the score for .
The next
q elements contain the score for
, for
.
The next
p elements are the scores for
, for
.
The next element contains the score for .
If , the next element contains the score for .
The final
nreg elements are the scores for
, for
.
- 13:
covar[] – doubleOutput
-
Note: the th element of the matrix is stored in .
On exit: the covariance matrix of the parameter estimates , that is the inverse of the Fisher Information Matrix.
- 14:
tdc – IntegerInput
-
On entry: the stride separating matrix column elements in the array
covar.
Constraint:
.
- 15:
hp – double *Input/Output
-
On entry: if
,
hp is the value to be used for the pre-observed conditional variance.
If
,
hp is not referenced.
On exit: if
,
hp is the estimated value of the pre-observed of the conditional variance.
- 16:
et[num] – doubleOutput
-
On exit: the estimated residuals, , for .
- 17:
ht[num] – doubleOutput
-
On exit: the estimated conditional variances, , for .
- 18:
lgf – double *Output
-
On exit: the value of the log likelihood function at .
- 19:
stat_opt – Nag_Garch_Stationary_TypeInput
On entry: if
, Stationary conditions are enforced.
If , Stationary conditions are not enforced.
Constraint:
or .
- 20:
est_opt – Nag_Garch_Est_Initial_TypeInput
On entry: if
, the function provides initial parameter estimates of the regression terms
.
If , you must supply the initial estimations of the regression parameters .
Constraint:
or .
- 21:
max_iter – IntegerInput
-
On entry: the maximum number of iterations to be used by the optimization function when estimating the GARCH
arguments. If
max_iter is set to
, the standard errors, score vector and variance-covariance are calculated for the input value of
in
theta; however the value of
is not updated.
Constraint:
.
- 22:
tol – doubleInput
-
On entry: the tolerance to be used by the optimization function when estimating the GARCH parameters.
- 23:
fail – NagError *Input/Output
-
The NAG error argument (see
Section 3.6 in the Essential Introduction).
- NE_2_INT_ARG_LT
-
On entry, while . These arguments must satisfy .
On entry, while . These arguments must satisfy .
On entry, while . These arguments must satisfy .
- NE_ALLOC_FAIL
-
Dynamic memory allocation failed.
- NE_BAD_PARAM
-
On entry, argument
est_opt had an illegal value.
On entry, argument
stat_opt had an illegal value.
- NE_INT_ARG_LT
-
On entry,
max_iter must not be less than 0:
.
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
- NE_INTERNAL_ERROR
-
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact
NAG for assistance.
- NE_INVALID_INT_RANGE_2
-
Value
given to
mn is not valid. Correct range is 0 to 1.
- NE_MAT_NOT_FULL_RANK
-
Matrix does not give a model of full rank.
- NE_MAT_NOT_POS_DEF
-
Attempt to invert the second derivative matrix needed in the calculation of the covariance matrix of the parameter estimates has failed. The matrix is not positive definite, possibly due to rounding errors.
Not applicable.
Not applicable.
None.
This example program illustrates the use of nag_estimate_agarchII (g13fcc) to model a GARCH(1,1) sequence generated by
nag_rand_agarchII (g05pec), a three step forecast is then calculated using
nag_forecast_agarchII (g13fdc).
None.