NAG FL Interface
g13fgf (uni_garch_exp_estim)
1
Purpose
g13fgf estimates the parameters of a univariate regression-exponential
process (see
Engle and Ng (1993)).
2
Specification
Fortran Interface
Subroutine g13fgf ( |
dist, yt, x, ldx, num, ip, iq, nreg, mn, npar, theta, se, sc, covr, ldcovr, pht, et, ht, lgf, copts, maxit, tol, work, lwork, ifail) |
Integer, Intent (In) |
:: |
ldx, num, ip, iq, nreg, mn, npar, ldcovr, maxit, lwork |
Integer, Intent (Inout) |
:: |
ifail |
Real (Kind=nag_wp), Intent (In) |
:: |
yt(num), x(ldx,*), tol |
Real (Kind=nag_wp), Intent (Inout) |
:: |
theta(npar), covr(ldcovr,npar), pht |
Real (Kind=nag_wp), Intent (Out) |
:: |
se(npar), sc(npar), et(num), ht(num), lgf, work(lwork) |
Logical, Intent (In) |
:: |
copts |
Character (1), Intent (In) |
:: |
dist |
|
C Header Interface
#include <nag.h>
void |
g13fgf_ (const char *dist, const double yt[], const double x[], const Integer *ldx, const Integer *num, const Integer *ip, const Integer *iq, const Integer *nreg, const Integer *mn, const Integer *npar, double theta[], double se[], double sc[], double covr[], const Integer *ldcovr, double *pht, double et[], double ht[], double *lgf, const logical *copts, const Integer *maxit, const double *tol, double work[], const Integer *lwork, Integer *ifail, const Charlen length_dist) |
|
C++ Header Interface
#include <nag.h> extern "C" {
void |
g13fgf_ (const char *dist, const double yt[], const double x[], const Integer &ldx, const Integer &num, const Integer &ip, const Integer &iq, const Integer &nreg, const Integer &mn, const Integer &npar, double theta[], double se[], double sc[], double covr[], const Integer &ldcovr, double &pht, double et[], double ht[], double &lgf, const logical &copts, const Integer &maxit, const double &tol, double work[], const Integer &lwork, Integer &ifail, const Charlen length_dist) |
}
|
The routine may be called by the names g13fgf or nagf_tsa_uni_garch_exp_estim.
3
Description
A univariate regression-exponential
process, with
coefficients
, for
,
coefficients
, for
,
coefficients,
, for
, and
linear regression coefficients
, for
, can be 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 terms in the sequence,
denotes the endogenous variables,
the exogenous variables,
the regression mean,
the regression coefficients,
the residuals,
the conditional variance,
the number of degrees of freedom of the Student's
-distribution, and
the set of all information up to time
.
g13fgf provides an estimate , for the vector where , when , and when .
mn,
nreg can be used to simplify the
expression in
(1) as follows:
No Regression and No Mean
- ,
- ,
- and
- is a vector when , and a vector, when .
No Regression
- ,
- ,
- and
- is a vector when and a vector, when .
Note: if the
, where
is known (not to be estimated by
g13fgf) then
(1) can be written as
, where
. This corresponds to the case
No Regression and No Mean, with
replaced by
.
No Mean
- ,
- ,
- and
- is a vector when and a vector, when .
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
Arguments
-
1:
– 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:
– Real (Kind=nag_wp) array
Input
-
On entry: the sequence of observations,
, for .
-
3:
– Real (Kind=nag_wp) array
Input
-
Note: the second dimension of the array
x
must be at least
.
On entry: row
of
x must contain the time dependent exogenous vector
, where
, for
.
-
4:
– Integer
Input
-
On entry: the first dimension of the array
x as declared in the (sub)program from which
g13fgf is called.
Constraint:
.
-
5:
– Integer
Input
-
On entry: , the number of terms in the sequence.
Constraints:
- ;
- .
-
6:
– Integer
Input
-
On entry: the number of coefficients,
, for .
Constraint:
(see also
npar).
-
7:
– Integer
Input
-
On entry: the number of coefficients,
, for .
Constraint:
(see also
npar).
-
8:
– Integer
Input
-
On entry: , the number of regression coefficients.
Constraint:
(see also
npar).
-
9:
– Integer
Input
-
On entry: if , the mean term will be included in the model.
Constraint:
or .
-
10:
– Integer
Input
-
On entry: the number of parameters to be included in the model. when and when .
Constraint:
.
-
11:
– Real (Kind=nag_wp) array
Input/Output
-
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 contain the coefficients
, for
.
The next
ip elements must contain the moving average coefficients
, for
.
If , the next element must contain an estimate for , the number of degrees of freedom of the Student's -distribution.
If , the next element must contain the mean term .
If
, the remaining
nreg elements are taken as initial estimates of the linear regression coefficients
, for
.
On exit: the estimated values
for the vector
.
The first element contains the coefficient
and the next
iq elements contain the coefficients
, for
.
The next
iq elements contain the coefficients
, for
.
The next
ip elements are the moving average coefficients
, for
.
If , the next element contains an estimate for then the number of degrees of freedom of the Student's -distribution.
If , the next element contains an estimate for the mean term .
The final
nreg elements are the estimated linear regression coefficients
, for
.
-
12:
– Real (Kind=nag_wp) array
Output
-
On exit: the standard errors for
.
The first element contains the standard error for
and the next
iq elements contain the standard errors for
, for
. The next
iq elements contain the standard errors for
, for
. The next
ip elements are the standard errors for
, for
.
If , the next element contains the standard error for , the number of degrees of freedom of the Student's -distribution.
If , the next element contains the standard error for .
The final
nreg elements are the standard errors for
, for
.
-
13:
– Real (Kind=nag_wp) array
Output
-
On exit: the scores for
.
The first element contains the scores for
, the next
iq elements contain the scores for
, for
, the next
iq elements contain the scores for
, for
, the next
ip elements are the scores for
, for
.
If , the next element contains the scores for , the number of degrees of freedom of the Student's -distribution.
If , the next element contains the score for .
The final
nreg elements are the scores for
, for
.
-
14:
– Real (Kind=nag_wp) array
Output
-
On exit: the covariance matrix of the parameter estimates , that is the inverse of the Fisher Information Matrix.
-
15:
– Integer
Input
-
On entry: the first dimension of the array
covr as declared in the (sub)program from which
g13fgf is called.
Constraint:
.
-
16:
– Real (Kind=nag_wp)
Input/Output
-
On entry: if
then
pht is the value to be used for the pre-observed conditional variance, otherwise
pht is not referenced.
On exit: if
then
pht is the estimated value of the pre-observed conditional variance.
-
17:
– Real (Kind=nag_wp) array
Output
-
On exit: the estimated residuals,
, for .
-
18:
– Real (Kind=nag_wp) array
Output
-
On exit: the estimated conditional variances,
, for .
-
19:
– Real (Kind=nag_wp)
Output
-
On exit: the value of the log-likelihood function at .
-
20:
– Logical
Input
-
On entry: if , the routine provides initial parameter estimates of the regression terms, otherwise these are provided by you.
-
21:
– Integer
Input
-
On entry: the maximum number of iterations to be used by the optimization routine when estimating the parameters.
Constraint:
.
-
22:
– Real (Kind=nag_wp)
Input
-
On entry: the tolerance to be used by the optimization routine when estimating the parameters.
-
23:
– Real (Kind=nag_wp) array
Workspace
-
24:
– Integer
Input
-
On entry: the dimension of the array
work as declared in the (sub)program from which
g13fgf is called.
Constraint:
.
-
25:
– Integer
Input/Output
-
On entry:
ifail must be set to
,
or
to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of means that an error message is printed while a value of means that it is not.
If halting is not appropriate, the value
or
is recommended. If message printing is undesirable, then the value
is recommended. Otherwise, the value
is recommended since useful values can be provided in some output arguments even when
on exit.
When the value or 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:
Note: in some cases g13fgf may return useful information.
-
On entry, .
Constraint: or .
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: or .
On entry, .
Constraint: if then ,
else .
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
-
On entry, .
Constraint: .
-
On entry, the matrix is not full rank.
-
The information matrix is not positive definite.
-
The maximum number of iterations has been reached.
-
The log-likelihood cannot be optimized any further.
-
No feasible model parameters could be found.
An unexpected error has been triggered by this routine. Please
contact
NAG.
See
Section 7 in the Introduction to the NAG Library FL Interface for further information.
Your licence key may have expired or may not have been installed correctly.
See
Section 8 in the Introduction to the NAG Library FL Interface for further information.
Dynamic memory allocation failed.
See
Section 9 in the Introduction to the NAG Library FL Interface for further information.
7
Accuracy
Not applicable.
8
Parallelism and Performance
g13fgf is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
g13fgf makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the
X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the
Users' Note for your implementation for any additional implementation-specific information.
None.
10
Example
This example fits a model with Student's -distributed residuals to some simulated data.
The process parameter estimates,
, are obtained using
g13fgf, and a four step ahead volatility estimate is computed using
g13fhf.
The data was simulated using
g05pgf.
10.1
Program Text
10.2
Program Data
10.3
Program Results