G13FCF (PDF version)
G13 Chapter Contents
G13 Chapter Introduction
NAG Library Manual

NAG Library Routine Document

G13FCF

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.

+ Contents

    1  Purpose
    7  Accuracy

1  Purpose

G13FCF estimates the parameters of a univariate regression-type II AGARCHp,q process.

2  Specification

SUBROUTINE G13FCF ( DIST, YT, X, LDX, NUM, IP, IQ, NREG, MN, NPAR, THETA, SE, SC, COVR, LDCOVR, HP, ET, HT, LGF, COPTS, MAXIT, TOL, WORK, LWORK, IFAIL)
INTEGER  LDX, NUM, IP, IQ, NREG, MN, 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 II 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:
yt = bo + xtT b + εt (1)
ht=α0+i=1qαi εt-i+γεt-i 2+i=1pβiht-i,  t=1,2,,T. (2)
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, and ψt the set of all information up to time t.
G13FCF 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'.
MN and NREG can be used to simplify the GARCHp,q expression in (1) as follows:
No Regression and No Mean
No Regression
Note:  if the yt=μ+εt, where μ is known (not to be estimated by G13FCF) 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

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 G13FCF is called.
Constraint: LDXNUM.
5:     NUM – INTEGERInput
On entry: T, the number of terms in the sequence.
Constraints:
  • NUMmaxIP,IQ;
  • NUMNREG+MN.
6:     IP – INTEGERInput
On entry: the number of coefficients, βi, for i=1,2,,p.
Constraint: IP0 (see also NPAR).
7:     IQ – INTEGERInput
On entry: the number of coefficients, αi, for i=1,2,,q.
Constraint: IQ1 (see also NPAR).
8:     NREG – INTEGERInput
On entry: k, the number of regression coefficients.
Constraint: NREG0 (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:   NPAR – INTEGERInput
On entry: the number of parameters to be included in the model. NPAR=2+IQ+IP+MN+NREG when DIST='N' and NPAR=3+IQ+IP+MN+NREG when DIST='T'.
Constraint: NPAR<20.
11:   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.
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 contains 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.
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.
12:   SE(NPAR) – REAL (KIND=nag_wp) arrayOutput
On exit: the standard errors for θ^.
The first element contains the standard error for αo and 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.
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.
13:   SC(NPAR) – REAL (KIND=nag_wp) arrayOutput
On exit: the scores for θ^.
The first element contains the score for αo and 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.
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.
14:   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.
15:   LDCOVR – INTEGERInput
On entry: the first dimension of the array COVR as declared in the (sub)program from which G13FCF is called.
Constraint: LDCOVRNPAR.
16:   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.
17:   ET(NUM) – REAL (KIND=nag_wp) arrayOutput
On exit: the estimated residuals, εt, for t=1,2,,T.
18:   HT(NUM) – REAL (KIND=nag_wp) arrayOutput
On exit: the estimated conditional variances, ht, for t=1,2,,T.
19:   LGF – REAL (KIND=nag_wp)Output
On exit: the value of the log-likelihood function at θ^.
20:   COPTS(2) – LOGICAL arrayInput
On entry: the options to be used by G13FCF.
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.
21:   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: MAXIT0.
22:   TOL – REAL (KIND=nag_wp)Input
On entry: the tolerance to be used by the optimization routine when estimating the GARCHp,q parameters.
23:   WORK(LWORK) – REAL (KIND=nag_wp) arrayWorkspace
24:   LWORK – INTEGERInput
On entry: the dimension of the array WORK as declared in the (sub)program from which G13FCF is called.
Constraint: LWORKNREG+3×NUM+NPAR+403.
25:   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 IFAIL0 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: G13FCF 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,
orMN>1,
orMN<0,
orIQ<1,
orIP<0,
orNPAR20,
orLDCOVR<NPAR,
orLDX<NUM,
orDIST'N', and DIST'T',
orMAXIT<0,
orNUM<NREG+MN,
orNPAR has an invalid value NUM<maxIP,IQ.
IFAIL=2
On entry, LWORK<NREG+3×NUM+3.
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 G13FCF, and a four step ahead volatility estimate is computed using G13FDF.
The data was simulated using G05PEF.

9.1  Program Text

Program Text (g13fcfe.f90)

9.2  Program Data

Program Data (g13fcfe.d)

9.3  Program Results

Program Results (g13fcfe.r)


G13FCF (PDF version)
G13 Chapter Contents
G13 Chapter Introduction
NAG Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2012