nag_rand_agarchI (g05pdc) (PDF version)
g05 Chapter Contents
g05 Chapter Introduction
NAG Library Manual

NAG Library Function Document

nag_rand_agarchI (g05pdc)

 Contents

    1  Purpose
    7  Accuracy

1  Purpose

nag_rand_agarchI (g05pdc) generates a given number of terms of a type I AGARCHp,q process (see Engle and Ng (1993)).

2  Specification

#include <nag.h>
#include <nagg05.h>
void  nag_rand_agarchI (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 type I AGARCHp,q process can be represented by:
ht = α0 + i=1q αi εt-i + γ 2 + i=1p βi ht-i ,   t=1,2,,T ;  
where εt ψ t-1 = N 0,ht  or εt ψt-1= St df,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 positive (or 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_agarchI (g05pdc).

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

1:     dist Nag_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:     num IntegerInput
On entry: T, the number of terms in the sequence.
Constraint: num0.
3:     ip IntegerInput
On entry: the number of coefficients, βi, for i=1,2,,p.
Constraint: ip0.
4:     iq IntegerInput
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=2,3,,ip+iq+1.
6:     gamma doubleInput
On entry: the asymmetry parameter γ for the GARCHp,q sequence.
7:     df IntegerInput
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:   fcall Nag_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_agarchI (g05pdc), with fcall=Nag_FALSE.
12:   lr IntegerInput
On entry: the dimension of the array r.
Constraint: lr2×ip+iq+2.
13:   state[dim] IntegerCommunication Array
Note: the dimension, dim, of this array is dictated by the requirements of associated functions that must have been previously called. This array MUST be the same array passed as argument state in the previous call to 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:   fail NagError *Input/Output
The NAG error argument (see Section 3.6 in the Essential Introduction).

6  Error Indicators and Warnings

NE_ALLOC_FAIL
Dynamic memory allocation failed.
See Section 3.2.1.2 in the Essential Introduction for further information.
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.
An unexpected error has been triggered by this function. Please contact NAG.
See Section 3.6.6 in the Essential Introduction for further information.
NE_INVALID_STATE
On entry, state vector has been corrupted or not initialized.
NE_NO_LICENCE
Your licence key may have expired or may not have been installed correctly.
See Section 3.6.5 in the Essential Introduction for further information.
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_ARRAY
On entry, sum of theta[i-1], for i=2,3,,ip+iq+1 is 1.0: sum=value.
On entry, theta[value]=value.
Constraint: theta[i-1]0.0.

7  Accuracy

Not applicable.

8  Parallelism and Performance

nag_rand_agarchI (g05pdc) is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
Please consult the X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this function. Please also consult the Users' Note for your implementation for any additional implementation-specific information.

9  Further Comments

None.

10  Example

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

10.1  Program Text

Program Text (g05pdce.c)

10.2  Program Data

None.

10.3  Program Results

Program Results (g05pdce.r)


nag_rand_agarchI (g05pdc) (PDF version)
g05 Chapter Contents
g05 Chapter Introduction
NAG Library Manual

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