nag_rand_garchGJR (g05pfc) (PDF version)
g05 Chapter Contents
g05 Chapter Introduction
NAG C Library Manual

NAG Library Function Document

nag_rand_garchGJR (g05pfc)

+ Contents

    1  Purpose
    7  Accuracy

1  Purpose

nag_rand_garchGJR (g05pfc) generates a given number of terms of a GJR GARCHp,q process (see Glosten et al. (1993)).

2  Specification

#include <nag.h>
#include <nagg05.h>
void  nag_rand_garchGJR (Nag_ErrorDistn dist, Integer num, Integer ip, Integer iq, const double theta[], double gamma, Integer df, double ht[], double et[], Nag_Boolean fcall, double r[], Integer lr, Integer state[], NagError *fail)

3  Description

A GJR GARCHp,q process is represented by:
ht = α0 + i=1q αi + γ It-i ε t-i 2 + i=1 p βi ht-i ,   t=1,2,,T ;
where It=1 if εt<0, It=0 if εt0, and εtψt-1=N0,ht or εtψt-1=Stdf,ht. Here St is a standardized Student's t-distribution with df degrees of freedom and variance ht, T is the number of observations in the sequence, εt is the observed value of the GARCHp,q process at time t, ht is the conditional variance at time t, and ψt the set of all information up to time t. Symmetric GARCH sequences are generated when γ is zero, otherwise asymmetric GARCH sequences are generated with γ specifying the amount by which negative shocks are to be enhanced.
One of the initialization functions nag_rand_init_repeatable (g05kfc) (for a repeatable sequence if computed sequentially) or nag_rand_init_nonrepeatable (g05kgc) (for a non-repeatable sequence) must be called prior to the first call to nag_rand_garchGJR (g05pfc).

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
Glosten L, Jagannathan R and Runkle D (1993) Relationship between the expected value and the volatility of nominal excess return on stocks Journal of Finance 48 1779–1801
Hamilton J (1994) Time Series Analysis Princeton University Press

5  Arguments

1:     distNag_ErrorDistnInput
On entry: the type of distribution to use for εt.
dist=Nag_NormalDistn
A Normal distribution is used.
dist=Nag_Tdistn
A Student's t-distribution is used.
Constraint: dist=Nag_NormalDistn or Nag_Tdistn.
2:     numIntegerInput
On entry: T, the number of terms in the sequence.
Constraint: num>0.
3:     ipIntegerInput
On entry: the number of coefficients, βi, for i=1,2,,p.
Constraint: ip0.
4:     iqIntegerInput
On entry: the number of coefficients, αi, for i=1,2,,q.
Constraint: iq1.
5:     theta[iq+ip+1]const doubleInput
On entry: the first element must contain the coefficient αo, the next iq elements must contain the coefficients αi, for i=1,2,,q. The remaining ip elements must contain the coefficients βj, for j=1,2,,p.
Constraints:
  • i=2 iq+ip+1 theta[i-1]<1.0;
  • theta[i-1]0.0, for i=1 and i=iq+2,,iq+ip+1.
6:     gammadoubleInput
On entry: the asymmetry parameter γ for the GARCHp,q sequence.
Constraint: gamma+theta[i-1]0.0, for i=2,3,,iq+1.
7:     dfIntegerInput
On entry: the number of degrees of freedom for the Student's t-distribution.
If dist=Nag_NormalDistn, df is not referenced.
Constraint: if dist=Nag_Tdistn, df>2.
8:     ht[num]doubleOutput
On exit: the conditional variances ht, for t=1,2,,T, for the GARCHp,q sequence.
9:     et[num]doubleOutput
On exit: the observations εt, for t=1,2,,T, for the GARCHp,q sequence.
10:   fcallNag_BooleanInput
On entry: if fcall=Nag_TRUE, a new sequence is to be generated, otherwise a given sequence is to be continued using the information in r.
11:   r[lr]doubleInput/Output
On entry: the array contains information required to continue a sequence if fcall=Nag_FALSE.
On exit: contains information that can be used in a subsequent call of nag_rand_garchGJR (g05pfc), with fcall=Nag_FALSE.
12:   lrIntegerInput
On entry: the dimension of the array r.
Constraint: lr2×ip+iq+2.
13:   state[dim]IntegerCommunication Array
Note: the actual argument supplied must be the array state supplied to the initialization functions nag_rand_init_repeatable (g05kfc) or nag_rand_init_nonrepeatable (g05kgc).
On entry: contains information on the selected base generator and its current state.
On exit: contains updated information on the state of the generator.
14:   failNagError *Input/Output
The NAG error argument (see Section 3.6 in the Essential Introduction).

6  Error Indicators and Warnings

NE_BAD_PARAM
On entry, argument value had an illegal value.
NE_INT
On entry, df=value.
Constraint: df3.
On entry, ip=value.
Constraint: ip0.
On entry, iq=value.
Constraint: iq1.
On entry, lr is not large enough, lr=value: minimum length required =value.
On entry, num=value.
Constraint: num0.
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_STATE
On entry, state vector has been corrupted or not initialized.
NE_PREV_CALL
ip or iq is not the same as when r was set up in a previous call.
Previous value of ip=value and ip=value.
Previous value of iq=value and iq=value.
NE_REAL_2
On entry, theta[value]=value and γ=value.
Constraint: αi+γ0.
NE_REAL_ARRAY
On entry, sum of theta[i]=value.
Constraint: sum of theta[i], for i=1,2,,ip+iq is <1.0.
On entry, theta[value]=value.
Constraint: theta[i]0.0.

7  Accuracy

Not applicable.

8  Further Comments

None.

9  Example

This example first calls nag_rand_init_repeatable (g05kfc) to initialize a base generator then calls nag_rand_garchGJR (g05pfc) to generate two realizations, each consisting of ten observations, from a GJR GARCH1,1 model.

9.1  Program Text

Program Text (g05pfce.c)

9.2  Program Data

None.

9.3  Program Results

Program Results (g05pfce.r)


nag_rand_garchGJR (g05pfc) (PDF version)
g05 Chapter Contents
g05 Chapter Introduction
NAG C Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2012