G05PFF (PDF version)
G05 Chapter Contents
G05 Chapter Introduction
NAG Library Manual

NAG Library Routine Document

G05PFF

Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.

+ Contents

    1  Purpose
    7  Accuracy

1  Purpose

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

2  Specification

SUBROUTINE G05PFF ( DIST, NUM, IP, IQ, THETA, GAMMA, DF, HT, ET, FCALL, R, LR, STATE, IFAIL)
INTEGER  NUM, IP, IQ, DF, LR, STATE(*), IFAIL
REAL (KIND=nag_wp)  THETA(IQ+IP+1), GAMMA, HT(NUM), ET(NUM), R(LR)
LOGICAL  FCALL
CHARACTER(1)  DIST

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 routines G05KFF (for a repeatable sequence if computed sequentially) or G05KGF (for a non-repeatable sequence) must be called prior to the first call to G05PFF.

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  Parameters

1:     DIST – CHARACTER(1)Input
On entry: the type of distribution to use for εt.
DIST='N'
A Normal distribution is used.
DIST='T'
A Student's t-distribution is used.
Constraint: DIST='N' or 'T'.
2:     NUM – INTEGERInput
On entry: T, the number of terms in the sequence.
Constraint: NUM>0.
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) – REAL (KIND=nag_wp) arrayInput
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 THETAi<1.0;
  • THETAi0.0, for i=1 and i=IQ+2,,IQ+IP+1.
6:     GAMMA – REAL (KIND=nag_wp)Input
On entry: the asymmetry parameter γ for the GARCHp,q sequence.
Constraint: GAMMA+THETAi0.0, for i=2,3,,IQ+1.
7:     DF – INTEGERInput
On entry: the number of degrees of freedom for the Student's t-distribution.
If DIST='N', DF is not referenced.
Constraint: if DIST='T', DF>2.
8:     HT(NUM) – REAL (KIND=nag_wp) arrayOutput
On exit: the conditional variances ht, for t=1,2,,T, for the GARCHp,q sequence.
9:     ET(NUM) – REAL (KIND=nag_wp) arrayOutput
On exit: the observations εt, for t=1,2,,T, for the GARCHp,q sequence.
10:   FCALL – LOGICALInput
On entry: if FCALL=.TRUE., a new sequence is to be generated, otherwise a given sequence is to be continued using the information in R.
11:   R(LR) – REAL (KIND=nag_wp) arrayInput/Output
On entry: the array contains information required to continue a sequence if FCALL=.FALSE..
On exit: contains information that can be used in a subsequent call of G05PFF, with FCALL=.FALSE..
12:   LR – INTEGERInput
On entry: the dimension of the array R as declared in the (sub)program from which G05PFF is called.
Constraint: LR2×IP+IQ+2.
13:   STATE(*) – INTEGER arrayCommunication Array
Note: the actual argument supplied must be the array STATE supplied to the initialization routines G05KFF or G05KGF.
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:   IFAIL – INTEGERInput/Output
On entry: IFAIL must be set to 0, -1​ or ​1. If you are unfamiliar with this parameter you should refer to Section 3.3 in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value -1​ or ​1 is recommended. If the output of error messages is undesirable, then the value 1 is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is 0. When the value -1​ or ​1 is used it is essential to test the value of IFAIL on exit.
On exit: IFAIL=0 unless the routine detects an error or a warning has been flagged (see Section 6).

6  Error Indicators and Warnings

If on entry IFAIL=0 or -1, explanatory error messages are output on the current error message unit (as defined by X04AAF).
Errors or warnings detected by the routine:
IFAIL=1
On entry,DIST'N' or 'T'.
IFAIL=2
On entry,NUM<0.
IFAIL=3
On entry,IP<0.
IFAIL=4
On entry,IQ<1.
IFAIL=5
On entry,α0<0,
orαi+γ<0 for some αi.
IFAIL=51
On entry, βi<0 for some βi.
IFAIL=52
On entry, i=1qαi+i=1pβi1.
IFAIL=7
On entry,DIST='T' and DF2.
IFAIL=11
The value of IP or IQ is not the same as when R was set up in a previous call.
IFAIL=12
On entry,LR<2×IP+IQ+2.
IFAIL=13
On entry,STATE vector was not initialized or has been corrupted.

7  Accuracy

Not applicable.

8  Further Comments

None.

9  Example

This example first calls G05KFF to initialize a base generator then calls G05PFF to generate two realisations, each consisting of ten observations, from a GJR GARCH1,1 model.

9.1  Program Text

Program Text (g05pffe.f90)

9.2  Program Data

Program Data (g05pffe.d)

9.3  Program Results

Program Results (g05pffe.r)


G05PFF (PDF version)
G05 Chapter Contents
G05 Chapter Introduction
NAG Library Manual

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