NAG Library Routine Document
G13FAF
1 Purpose
G13FAF estimates the parameters of either a standard univariate regression GARCH process, or a univariate regression-type I
AGARCHp,q process (see
Engle and Ng (1993)).
2 Specification
SUBROUTINE G13FAF ( |
DIST, YT, X, LDX, NUM, IP, IQ, NREG, MN, ISYM, NPAR, THETA, SE, SC, COVR, LDCOVR, HP, ET, HT, LGF, COPTS, MAXIT, TOL, WORK, LWORK, IFAIL) |
INTEGER |
LDX, NUM, IP, IQ, NREG, MN, ISYM, NPAR, LDCOVR, MAXIT, LWORK, IFAIL |
REAL (KIND=nag_wp) |
YT(NUM), X(LDX,*), THETA(NPAR), SE(NPAR), SC(NPAR), COVR(LDCOVR,NPAR), HP, ET(NUM), HT(NUM), LGF, TOL, WORK(LWORK) |
LOGICAL |
COPTS(2) |
CHARACTER(1) |
DIST |
|
3 Description
A univariate regression-type I
AGARCHp,q process, with
q coefficients
αi, for
i=1,2,…,q,
p coefficients
βi, for
i=1,2,…,p, and
k linear regression coefficients
bi, for
i=1,2,…,k, can be represented by:
where
ε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 terms in the sequence,
yt denotes the endogenous variables,
xt the exogenous variables,
bo the regression mean,
b the regression coefficients,
εt the residuals,
ht the conditional variance,
df the number of degrees of freedom of the Student's
t-distribution, and
ψt the set of all information up to time
t.
G13FAF provides an estimate for θ^, the parameter vector θ=bo,bT,ωT where bT=b1,…,bk, ωT=α0,α1,…,αq,β1,…,βp,γ when DIST='N' and ωT=α0,α1,…,αq,β1,…,βp,γ,df when DIST='T'.
ISYM,
MN and
NREG can be used to simplify the
GARCHp,q expression in
(1) as follows:
No Regression and No Mean
- yt=εt,
- ISYM=0,
- MN=0,
- NREG=0 and
- θ is a
p+q+1 vector when DIST='N' and a p+q+2 vector when DIST='T'.
No Regression
- yt=bo+εt,
- ISYM=0,
- MN=1,
- NREG=0 and
- θ is a
p+q+2 vector when DIST='N' and a p+q+3 vector when DIST='T'.
Note: if the
yt=μ+εt, where
μ is known (not to be estimated by G13FAF) then
(1) can be written as
ytμ=εt, where
ytμ=yt-μ. This corresponds to the case
No Regression and No Mean, with
yt replaced by
yt-μ.
No Mean
-
yt
=
xtT
b
+
εt
,
- ISYM=0,
- MN=0,
- NREG=k and
- θ is a
p+q+k+1 vector when DIST='N' and a p+q+k+2 vector when DIST='T'.
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 Parameters
- 1: DIST – CHARACTER(1)Input
On entry: the type of distribution to use for
et.
- DIST='N'
- A Normal distribution is used.
- DIST='T'
- A Student's t-distribution is used.
Constraint:
DIST='N' or 'T'.
- 2: YT(NUM) – REAL (KIND=nag_wp) arrayInput
On entry: the sequence of observations,
yt, for t=1,2,…,T.
- 3: X(LDX,*) – REAL (KIND=nag_wp) arrayInput
-
Note: the second dimension of the array
X
must be at least
NREG.
On entry: row
t of
X must contain the time dependent exogenous vector
xt , where
xtT = xt1,…,xtk , for
t=1,2,…,T.
- 4: LDX – INTEGERInput
On entry: the first dimension of the array
X as declared in the (sub)program from which G13FAF is called.
Constraint:
LDX≥NUM.
- 5: NUM – INTEGERInput
On entry: T, the number of terms in the sequence.
Constraints:
- NUM≥maxIP,IQ;
- NUM≥NREG+MN.
- 6: IP – INTEGERInput
On entry: the number of coefficients,
βi, for i=1,2,…,p.
Constraint:
IP≥0 (see also
NPAR).
- 7: IQ – INTEGERInput
On entry: the number of coefficients,
αi, for i=1,2,…,q.
Constraint:
IQ≥1 (see also
NPAR).
- 8: NREG – INTEGERInput
On entry: k, the number of regression coefficients.
Constraint:
NREG≥0 (see also
NPAR).
- 9: MN – INTEGERInput
On entry: if MN=1, the mean term b0 will be included in the model.
Constraint:
MN=0 or 1.
- 10: ISYM – INTEGERInput
On entry: if ISYM=1, the asymmetry term γ will be included in the model.
Constraint:
ISYM=0 or 1.
- 11: NPAR – INTEGERInput
On entry: the number of parameters to be included in the model. NPAR=1+IQ+IP+ISYM+MN+NREG when DIST='N', and NPAR=2+IQ+IP+ISYM+MN+NREG when DIST='T'.
Constraint:
NPAR<20.
- 12: THETA(NPAR) – REAL (KIND=nag_wp) arrayInput/Output
On entry: the initial parameter estimates for the vector
θ.
The first element must contain the coefficient
αo and the next
IQ elements must contain the coefficients
αi, for
i=1,2,…,q.
The next
IP elements must contain the coefficients
βj, for
j=1,2,…,p.
If ISYM=1, the next element must contain the asymmetry parameter γ.
If DIST='T', the next element must contain df, the number of degrees of freedom of the Student's t-distribution.
If MN=1, the next element must contain the mean term bo.
If
COPTS2=.FALSE., the remaining
NREG elements are taken as initial estimates of the linear regression coefficients
bi, for
i=1,2,…,k.
On exit: the estimated values
θ^ for the vector
θ.
The first element contains the coefficient
αo, the next
IQ elements contain the coefficients
αi, for
i=1,2,…,q.
The next
IP elements are the coefficients
βj, for
j=1,2,…,p.
If ISYM=1, the next element contains the estimate for the asymmetry parameter γ.
If DIST='T', the next element contains an estimate for df, the number of degrees of freedom of the Student's t-distribution.
If MN=1, the next element contains an estimate for the mean term bo.
The final
NREG elements are the estimated linear regression coefficients
bi, for
i=1,2,…,k.
- 13: SE(NPAR) – REAL (KIND=nag_wp) arrayOutput
On exit: the standard errors for
θ^.
The first element contains the standard error for
αo. The next
IQ elements contain the standard errors for
αi, for
i=1,2,…,q. The next
IP elements are the standard errors for
βj, for
j=1,2,…,p.
If ISYM=1, the next element contains the standard error for γ.
If DIST='T', the next element contains the standard error for df, the number of degrees of freedom of the Student's t-distribution.
If MN=1, the next element contains the standard error for bo.
The final
NREG elements are the standard errors for
bj, for
j=1,2,…,k.
- 14: SC(NPAR) – REAL (KIND=nag_wp) arrayOutput
On exit: the scores for
θ^.
The first element contains the score for αo.
The next
IQ elements contain the score for
αi, for
i=1,2,…,q.
The next
IP elements are the scores for
βj, for
j=1,2,…,p.
If ISYM=1, the next element contains the score for γ.
If DIST='T', the next element contains the score for df, the number of degrees of freedom of the Student's t-distribution.
If MN=1, the next element contains the score for bo.
The final
NREG elements are the scores for
bj, for
j=1,2,…,k.
- 15: COVR(LDCOVR,NPAR) – REAL (KIND=nag_wp) arrayOutput
On exit: the covariance matrix of the parameter estimates θ^, that is the inverse of the Fisher Information Matrix.
- 16: LDCOVR – INTEGERInput
On entry: the first dimension of the array
COVR as declared in the (sub)program from which G13FAF is called.
Constraint:
LDCOVR≥NPAR.
- 17: HP – REAL (KIND=nag_wp)Input/Output
On entry: if
COPTS2=.FALSE.,
HP is the value to be used for the pre-observed conditional variance; otherwise
HP is not referenced.
On exit: if
COPTS2=.TRUE.,
HP is the estimated value of the pre-observed conditional variance.
- 18: ET(NUM) – REAL (KIND=nag_wp) arrayOutput
On exit: the estimated residuals,
εt, for t=1,2,…,T.
- 19: HT(NUM) – REAL (KIND=nag_wp) arrayOutput
On exit: the estimated conditional variances,
ht, for t=1,2,…,T.
- 20: LGF – REAL (KIND=nag_wp)Output
On exit: the value of the log-likelihood function at θ^.
- 21: COPTS(2) – LOGICAL arrayInput
On entry: the options to be used by G13FAF.
- COPTS1=.TRUE.
- Stationary conditions are enforced, otherwise they are not.
- COPTS2=.TRUE.
- The routine provides initial parameter estimates of the regression terms, otherwise these are to be provided by you.
- 22: MAXIT – INTEGERInput
On entry: the maximum number of iterations to be used by the optimization routine when estimating the
GARCHp,q parameters. If
MAXIT is set to
0, the standard errors, score vector and variance-covariance are calculated for the input value of
θ in
THETA; however the value of
θ is not updated.
Constraint:
MAXIT≥0.
- 23: TOL – REAL (KIND=nag_wp)Input
On entry: the tolerance to be used by the optimization routine when estimating the GARCHp,q parameters.
- 24: WORK(LWORK) – REAL (KIND=nag_wp) arrayWorkspace
- 25: LWORK – INTEGERInput
On entry: the dimension of the array
WORK as declared in the (sub)program from which G13FAF is called.
Constraint:
LWORK≥NREG+3×NUM+NPAR+403.
- 26: 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, because for this routine the values of the output parameters may be useful even if
IFAIL≠0 on exit, the recommended value is
-1.
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).
Note: G13FAF may return useful information for one or more of the following detected errors or warnings.
Errors or warnings detected by the routine:
- IFAIL=1
On entry, | NREG<0, |
or | MN>1, |
or | MN<0, |
or | ISYM>1, |
or | ISYM<0, |
or | IQ<1, |
or | IP<0, |
or | NPAR≥20, |
or | NPAR has an invalid value, |
or | LDCOVR<NPAR, |
or | LDX<NUM, |
or | DIST≠'N', |
or | DIST≠'T', |
or | MAXIT<0, |
or | NUM<maxIP,IQ, |
or | NUM<NREG+MN. |
- IFAIL=2
On entry, | LWORK<NREG+3×NUM+NPAR+403. |
- IFAIL=3
The matrix X is not full rank.
- IFAIL=4
The information matrix is not positive definite.
- IFAIL=5
-
The maximum number of iterations has been reached.
- IFAIL=6
-
The log-likelihood cannot be optimized any further.
- IFAIL=7
-
No feasible model parameters could be found.
7 Accuracy
Not applicable.
8 Further Comments
None.
9 Example
This example fits a GARCH1,1 model with Student's t-distributed residuals to some simulated data.
The process parameter estimates,
θ^, are obtained using G13FAF, and a four step ahead volatility estimate is computed using
G13FBF.
The data was simulated using
G05PDF.
9.1 Program Text
Program Text (g13fafe.f90)
9.2 Program Data
Program Data (g13fafe.d)
9.3 Program Results
Program Results (g13fafe.r)