NAG CL Interface
g13fac (uni_​garch_​asym1_​estim)

1 Purpose

g13fac estimates the parameters of a standard univariate regression-GARCH p,q or a univariate regression-type I AGARCH p,q process (see Engle and Ng (1993)).

2 Specification

#include <nag.h>
void  g13fac (const double yt[], const double x[], Integer tdx, Integer num, Integer p, Integer q, Integer nreg, Integer mn, Integer isym, 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)
The function may be called by the names: g13fac, nag_tsa_uni_garch_asym1_estim or nag_estimate_agarchi.

3 Description

When isym=0 , g13fac models a standard γ=0 univariate regression-GARCH p,q process, with p coefficients α i , for i=1,2,,p, q coefficients, β i , for i=1,2,,q, mean b o , and k linear regression coefficients b i , for i=1,2,,k, which can be represented by:
y t = b o + xtT b + ε t (1)
ε t ψ t-1 N 0, h t  
h t = α 0 + i=1 q α i ε t-i 2 + i=1 p β i h t-i ,   t = 1 , , T .  
When isym=1 , g13fac models an asymmetric GARCH p,q process where the conditional variance h t is given by:
h t = α 0 + i=1 q α i ε t-i + γ 2 + i=1 p β i h t-i ,   t = 1 , , T .  
Here T the number of terms in the sequence, y t denotes the endogenous variables, x t the exogenous variables, b o the mean, b the regression coefficients, ε t the residuals, γ the asymmetry parameter, h t the conditional variance, and ψ t the information set of all information up to time t .
When isym=1 , g13fac provides an estimate for θ ^ , the p + q + k + 3 × 1 parameter vector θ = b o ,bT, ω T where ω T = α 0 , α 1 , , α q , β 1 , , β p , γ and bT = b 1 , , b k .
isym, mn, nreg can be used to simplify the GARCH p,q expression in (1) as follows:
No Regression or Mean
No Regression
Note: if the y t = μ + ε t , where μ is known (not to be estimated by g13fac) then (1) can be written as y t μ = ε t , where y t μ = y t - μ . This corresponds to the case No Regression or Mean, with y t replaced by y t - μ .
No Mean

4 References

Bollerslev T (1986) Generalised autoregressive conditional heteroskedasticity Journal of Econometrics 31 307–327
Engle R (1982) Autoregressive conditional heteroskedasticity with estimates of the variance of United Kingdom inflation Econometrica 50 987–1008
Engle R and Ng V (1993) Measuring and testing the impact of news on volatility Journal of Finance 48 1749–1777
Hamilton J (1994) Time Series Analysis Princeton University Press

5 Arguments

Note: for convenience npar will be used here to denote the expression 1 + q + p + isym + mn + nreg representing the number of model parameters.
1: yt[num] const double Input
On entry: the sequence of observations, y t , for t=1,2,,T.
2: x[num×tdx] const double Input
Note: ith element of the jth vector X is stored in x[i-1×tdx+j-1].
On entry: row t of x must contain the time dependent exogenous vector x t , where xtT = x t 1 , , x t k , for t=1,2,,T.
3: tdx Integer Input
On entry: the stride separating matrix column elements in the array x.
Constraint: tdxnreg .
4: num Integer Input
On entry: the number of terms in the sequence, T .
Constraint: num npar .
5: p Integer Input
On entry: the GARCH p,q parameter p .
Constraint: p0 .
6: q Integer Input
On entry: the GARCH p,q parameter q .
Constraint: q1 .
7: nreg Integer Input
On entry: k , the number of refression coefficients.
Constraint: nreg0 .
8: mn Integer Input
On entry: if mn=1 , the mean term b 0 will be included in the model.
Constraint: mn=0 or 1.
9: isym Integer Input
On entry: if isym=1 , the asymmetry term γ will be included in the model.
Constraint: isym=0 or 1.
10: theta[npar] double Input/Output
On entry: the initial parameter estimates for the vector θ .
The first element contains the coefficient α o , the next q elements contain the autoregressive coefficients α i , for i=1,2,,q.
The next p elements are the moving average coefficients β j , for j=1,2,,p.
The next element contains the asymmetry parameter γ .
If est_opt=Nag_Garch_Est_Initial_False, (when mn=1 ) the next term contains an initial estimate of the mean term b o and the remaining nreg elements are taken as initial estimates of the linear regression coefficients b i , for i=1,2,,k.
On exit: the estimated values θ ^ for the vector θ .
The first element contains the coefficient α o , the next q elements contain the coefficients α i , for i=1,2,,q.
The next p elements are the coefficients β j , for j=1,2,,p.
The next element contains the estimate for the asymmetry parameter γ .
If mn=1 , the next element contains an estimate for the mean term b o .
The final nreg elements are the estimated linear regression coefficients b i , for i=1,2,,k.
11: se[npar] double Output
On exit: the standard errors for θ ^ .
The first element contains the standard error for α o .
The next q elements contain the standard errors for α i , for i=1,2,,q.
The next p elements are the standard errors for β j , for j=1,2,,p.
If isym=1 , the next element contains the standard error for γ .
If mn=1 , the next element contains the standard error for b o .
The final nreg elements are the standard errors for b j , for j=1,2,,k.
12: sc[npar] double Output
On exit: the scores for θ ^ .
The first element contains the score for α o .
The next q elements contain the score for α i , for i=1,2,,q.
The next p elements are the scores for β j , for j=1,2,,p.
If isym=1 , the next element contains the score for γ .
If mn=1 , the next element contains the score for b o .
The final nreg elements are the scores for b j , for j=1,2,,k.
13: covar[npar×tdc] double Output
Note: the i,jth element of the matrix is stored in covar[i-1×tdc+j-1].
On exit: the covariance matrix of the parameter estimates θ ^ , that is the inverse of the Fisher Information Matrix.
14: tdc Integer Input
On entry: the stride separating matrix column elements in the array covar.
Constraint: tdc npar .
15: hp double * Input/Output
On entry: if est_opt=Nag_Garch_Est_Initial_False, hp is the value to be used for the pre-observed conditional variance.
If est_opt=Nag_Garch_Est_Initial_True, hp is not referenced.
On exit: if est_opt=Nag_Garch_Est_Initial_True, hp is the estimated value of the pre-observed of the conditional variance.
16: et[num] double Output
On exit: the estimated residuals, ε t , for t=1,2,,T.
17: ht[num] double Output
On exit: the estimated conditional variances, h t , for t=1,2,,T.
18: lgf double * Output
On exit: the value of the log-likelihood function at θ ^ .
19: stat_opt Nag_Garch_Stationary_Type Input
On entry: if stat_opt=Nag_Garch_Stationary_True, Stationary conditions are enforced.
If stat_opt=Nag_Garch_Stationary_False, Stationary conditions are not enforced.
Constraint: stat_opt=Nag_Garch_Stationary_True or Nag_Garch_Stationary_False.
20: est_opt Nag_Garch_Est_Initial_Type Input
On entry: if est_opt=Nag_Garch_Est_Initial_True, the function provides initial parameter estimates of the regression terms b 0 , bT .
If est_opt=Nag_Garch_Est_Initial_False, you must supply the initial estimations of the regression parameters b 0 , bT .
Constraint: est_opt=Nag_Garch_Est_Initial_True or Nag_Garch_Est_Initial_False.
21: max_iter Integer Input
On entry: the maximum number of iterations to be used by the optimization function when estimating the GARCH p,q parameters. If max_iter is set to 0, 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: max_iter0 .
22: tol double Input
On entry: the tolerance to be used by the optimization function when estimating the GARCH p,q parameters.
23: fail NagError * Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).

6 Error Indicators and Warnings

NE_2_INT_ARG_LT
On entry, num=value while 1 + q + p + isym + mn + nreg = value. These parameters must satisfy num 1 + q + p + isym + mn + nreg .
On entry, tdc=value while 1 + q + p + isym + mn + nreg = value. These parameters must satisfy tdc 1 + q + p + isym + mn + nreg .
On entry, tdx=value while nreg=value . These parameters must satisfy tdxnreg .
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: max_iter=value .
On entry, nreg=value.
Constraint: nreg0.
On entry, p=value.
Constraint: p0.
On entry, q=value.
Constraint: q1.
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 value given to isym is not valid. Correct range is 0 to 1.
Value value given to mn is not valid. Correct range is 0 to 1.
NE_MAT_NOT_FULL_RANK
Matrix X 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.

7 Accuracy

Not applicable.

8 Parallelism and Performance

g13fac is not threaded in any implementation.

9 Further Comments

None.

10 Example

This example program illustrates the use of g13fac to model a GARCH(1,1) sequence generated by g05pdc, a three step forecast is then calculated using g13fbc.

10.1 Program Text

Program Text (g13face.c)

10.2 Program Data

None.

10.3 Program Results

Program Results (g13face.r)