NAG CL Interface
g05pdc (times_​garch_​asym1)

Settings help

CL Name Style:

1 Purpose

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

2 Specification

#include <nag.h>
void  g05pdc (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)
The function may be called by the names: g05pdc, nag_rand_times_garch_asym1 or nag_rand_agarchi.

3 Description

A type I AGARCH(p,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 GARCH(p,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 g05kfc (for a repeatable sequence if computed sequentially) or g05kgc (for a non-repeatable sequence) must be called prior to the first call to 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_ErrorDistn Input
On entry: the type of distribution to use for εt.
A Normal distribution is used.
A Student's t-distribution is used.
Constraint: dist=Nag_NormalDistn or Nag_Tdistn.
2: num Integer Input
On entry: T, the number of terms in the sequence.
Constraint: num0.
3: ip Integer Input
On entry: the number of coefficients, βi, for i=1,2,,p.
Constraint: ip0.
4: iq Integer Input
On entry: the number of coefficients, αi, for i=1,2,,q.
Constraint: iq1.
5: theta[iq+ip+1] const double Input
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.
  • i=2 iq+ip+1 theta[i-1]<1.0;
  • theta[i-1]0.0, for i=2,3,,ip+iq+1.
6: gamma double Input
On entry: the asymmetry parameter γ for the GARCH(p,q) sequence.
7: df Integer Input
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] double Output
On exit: the conditional variances ht, for t=1,2,,T, for the GARCH(p,q) sequence.
9: et[num] double Output
On exit: the observations εt, for t=1,2,,T, for the GARCH(p,q) sequence.
10: fcall Nag_Boolean Input
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] double Communication Array
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 g05pdc, with fcall=Nag_FALSE.
12: lr Integer Input
On entry: the dimension of the array r.
Constraint: lr2×(ip+iq+2).
13: state[dim] Integer Communication 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 7 in the Introduction to the NAG Library CL Interface).

6 Error Indicators and Warnings

Dynamic memory allocation failed.
See Section 3.1.2 in the Introduction to the NAG Library CL Interface for further information.
On entry, argument value had an illegal value.
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.
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.
See Section 7.5 in the Introduction to the NAG Library CL Interface for further information.
On entry, state vector has been corrupted or not initialized.
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library CL Interface for further information.
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.
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

Background information to multithreading can be found in the Multithreading documentation.
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


10 Example

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

10.1 Program Text

Program Text (g05pdce.c)

10.2 Program Data


10.3 Program Results

Program Results (g05pdce.r)