g05pfc generates a given number of terms of a GJR
process (see
Glosten et al. (1993)).
A GJR
process is represented by:
where
if
,
if
, and
or
. Here
is a standardized Student's
-distribution with
degrees of freedom and variance
,
is the number of observations in the sequence,
is the observed value of the
process at time
,
is the conditional variance at time
, and
the set of all information up to time
. 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
g05kfc (for a repeatable sequence if computed sequentially) or
g05kgc (for a non-repeatable sequence) must be called prior to the first call to
g05pfc.
Engle R (1982) Autoregressive conditional heteroskedasticity with estimates of the variance of United Kingdom inflation Econometrica 50 987–1008
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
-
1:
– Nag_ErrorDistn
Input
-
On entry: the type of distribution to use for
.
- A Normal distribution is used.
- A Student's -distribution is used.
Constraint:
or .
-
2:
– Integer
Input
-
On entry: , the number of terms in the sequence.
Constraint:
.
-
3:
– Integer
Input
-
On entry: the number of coefficients,
, for .
Constraint:
.
-
4:
– Integer
Input
-
On entry: the number of coefficients,
, for .
Constraint:
.
-
5:
– const double
Input
-
On entry: the first element must contain the coefficient
, the next
iq elements must contain the coefficients
, for
. The remaining
ip elements must contain the coefficients
, for
.
Constraints:
- ;
- , for and .
-
6:
– double
Input
-
On entry: the asymmetry parameter for the sequence.
Constraint:
, for .
-
7:
– Integer
Input
-
On entry: the number of degrees of freedom for the Student's
-distribution.
If
,
df is not referenced.
Constraint:
if , .
-
8:
– double
Output
-
On exit: the conditional variances
, for , for the sequence.
-
9:
– double
Output
-
On exit: the observations
, for , for the sequence.
-
10:
– Nag_Boolean
Input
-
On entry: if
, a new sequence is to be generated, otherwise a given sequence is to be continued using the information in
r.
-
11:
– double
Communication Array
-
On entry: the array contains information required to continue a sequence if .
On exit: contains information that can be used in a subsequent call of g05pfc, with .
-
12:
– Integer
Input
-
On entry: the dimension of the array
r.
Constraint:
.
-
13:
– Integer
Communication Array
Note: the dimension,
, 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:
– NagError *
Input/Output
-
The NAG error argument (see
Section 7 in the Introduction to the NAG Library CL Interface).
- NE_ALLOC_FAIL
-
Dynamic memory allocation failed.
See
Section 3.1.2 in the Introduction to the NAG Library CL Interface for further information.
- NE_BAD_PARAM
-
On entry, argument had an illegal value.
- NE_INT
-
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry,
lr is not large enough,
: minimum length required
.
On entry, .
Constraint: .
- 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.
See
Section 7.5 in the Introduction to the NAG Library CL Interface 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 8 in the Introduction to the NAG Library CL Interface 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
and
.
Previous value of
and
.
- NE_REAL_2
-
On entry, and .
Constraint: .
- NE_REAL_ARRAY
-
On entry, sum of .
Constraint: sum of , for is .
On entry, .
Constraint: .
Not applicable.
Background information to multithreading can be found in the
Multithreading documentation.
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.
None.
This example first calls
g05kfc to initialize a base generator then calls
g05pfc to generate two realizations, each consisting of ten observations, from a GJR
model.
None.