NAG Library Routine Document
G05PGF
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.
1 Purpose
G05PGF generates a given number of terms of an exponential
process (see
Engle and Ng (1993)).
2 Specification
SUBROUTINE G05PGF (
DIST,
NUM,
IP,
IQ,
THETA,
DF,
HT,
ET,
FCALL,
R,
LR,
STATE,
IFAIL)
INTEGER
NUM, IP, IQ, DF, LR, STATE(*), IFAIL
REAL (KIND=nag_wp)
THETA(2*IQ+IP+1), HT(NUM), ET(NUM), R(LR)
LOGICAL
FCALL
CHARACTER(1)
DIST
3 Description
An exponential
process is represented by:
where
,
denotes the expected value of
, 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
.
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 G05PGF.
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
.
- A Normal distribution is used.
- A Student's -distribution is used.
Constraint:
or .
- 2: NUM – INTEGERInput
On entry: , the number of terms in the sequence.
Constraint:
.
- 3: IP – INTEGERInput
On entry: the number of coefficients,
, for .
Constraint:
.
- 4: IQ – INTEGERInput
On entry: the number of coefficients,
, for .
Constraint:
.
- 5: THETA() – REAL (KIND=nag_wp) arrayInput
On entry: the initial parameter estimates for the vector
. The first element must contain the coefficient
and the next
IQ elements must contain the autoregressive coefficients
, for
. The next
IQ elements must contain the coefficients
, for
. The next
IP elements must contain the moving average coefficients
, for
.
Constraints:
- ;
- .
- 6: DF – INTEGERInput
On entry: the number of degrees of freedom for the Student's
-distribution.
If
,
DF is not referenced.
Constraint:
if , .
- 7: HT(NUM) – REAL (KIND=nag_wp) arrayOutput
On exit: the conditional variances
, for , for the sequence.
- 8: ET(NUM) – REAL (KIND=nag_wp) arrayOutput
On exit: the observations
, for , for the sequence.
- 9: FCALL – LOGICALInput
On entry: if
, a new sequence is to be generated, otherwise a given sequence is to be continued using the information in
R.
- 10: R(LR) – REAL (KIND=nag_wp) arrayInput/Output
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 G05PGF, with .
- 11: LR – INTEGERInput
On entry: the dimension of the array
R as declared in the (sub)program from which G05PGF is called.
Constraint:
.
- 12: 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.
- 13: IFAIL – INTEGERInput/Output
-
On entry:
IFAIL must be set to
,
. 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
is recommended. If the output of error messages is undesirable, then the value
is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is
.
When the value is used it is essential to test the value of IFAIL on exit.
On exit:
unless the routine detects an error or a warning has been flagged (see
Section 6).
6 Error Indicators and Warnings
If on entry
or
, explanatory error messages are output on the current error message unit (as defined by
X04AAF).
Errors or warnings detected by the routine:
On entry, or .
On entry, .
On entry, .
On entry, .
On entry, and .
The value of
IP or
IQ is not the same as when
R was set up in a previous call.
On entry, .
On entry,
STATE vector was not initialized or has been corrupted.
Invalid sequence generated, use different parameters.
7 Accuracy
Not applicable.
None.
9 Example
This example first calls
G05KFF to initialize a base generator then calls G05PGF to generate two realisations, each consisting of ten observations, from an exponential
model.
9.1 Program Text
Program Text (g05pgfe.f90)
9.2 Program Data
Program Data (g05pgfe.d)
9.3 Program Results
Program Results (g05pgfe.r)