g13fg estimates the parameters of a univariate regression-exponential GARCHp,q process (see Engle and Ng (1993)).

Syntax

C#
public static void g13fg(
	string dist,
	double[] yt,
	double[,] x,
	int num,
	int ip,
	int iq,
	int nreg,
	int mn,
	int npar,
	double[] theta,
	double[] se,
	double[] sc,
	double[,] covr,
	ref double hp,
	double[] et,
	double[] ht,
	out double lgf,
	bool copts,
	int maxit,
	double tol,
	out int ifail
)
Visual Basic
Public Shared Sub g13fg ( _
	dist As String, _
	yt As Double(), _
	x As Double(,), _
	num As Integer, _
	ip As Integer, _
	iq As Integer, _
	nreg As Integer, _
	mn As Integer, _
	npar As Integer, _
	theta As Double(), _
	se As Double(), _
	sc As Double(), _
	covr As Double(,), _
	ByRef hp As Double, _
	et As Double(), _
	ht As Double(), _
	<OutAttribute> ByRef lgf As Double, _
	copts As Boolean, _
	maxit As Integer, _
	tol As Double, _
	<OutAttribute> ByRef ifail As Integer _
)
Visual C++
public:
static void g13fg(
	String^ dist, 
	array<double>^ yt, 
	array<double,2>^ x, 
	int num, 
	int ip, 
	int iq, 
	int nreg, 
	int mn, 
	int npar, 
	array<double>^ theta, 
	array<double>^ se, 
	array<double>^ sc, 
	array<double,2>^ covr, 
	double% hp, 
	array<double>^ et, 
	array<double>^ ht, 
	[OutAttribute] double% lgf, 
	bool copts, 
	int maxit, 
	double tol, 
	[OutAttribute] int% ifail
)
F#
static member g13fg : 
        dist : string * 
        yt : float[] * 
        x : float[,] * 
        num : int * 
        ip : int * 
        iq : int * 
        nreg : int * 
        mn : int * 
        npar : int * 
        theta : float[] * 
        se : float[] * 
        sc : float[] * 
        covr : float[,] * 
        hp : float byref * 
        et : float[] * 
        ht : float[] * 
        lgf : float byref * 
        copts : bool * 
        maxit : int * 
        tol : float * 
        ifail : int byref -> unit 

Parameters

dist
Type: System..::..String
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".
yt
Type: array<System..::..Double>[]()[][]
An array of size [num]
On entry: the sequence of observations, yt, for t=1,2,,T.
x
Type: array<System..::..Double,2>[,](,)[,][,]
An array of size [dim1, dim2]
Note: dim1 must satisfy the constraint: dim1num
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.
num
Type: System..::..Int32
On entry: T, the number of terms in the sequence.
Constraints:
  • nummaxip,iq;
  • numnreg+mn.
ip
Type: System..::..Int32
On entry: the number of coefficients, βi, for i=1,2,,p.
Constraint: ip0 (see also npar).
iq
Type: System..::..Int32
On entry: the number of coefficients, αi, for i=1,2,,q.
Constraint: iq1 (see also npar).
nreg
Type: System..::..Int32
On entry: k, the number of regression coefficients.
Constraint: nreg0 (see also npar).
mn
Type: System..::..Int32
On entry: if mn=1, the mean term b0 will be included in the model.
Constraint: mn=0 or 1.
npar
Type: System..::..Int32
On entry: the number of parameters to be included in the model. npar=1+2×iq+ip+mn+nreg when dist="N" and npar=2+2×iq+ip+mn+nreg when dist="T".
Constraint: npar<20.
theta
Type: array<System..::..Double>[]()[][]
An array of size [npar]
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 autoregressive coefficients αi, for i=1,2,,q.
The next iq elements contain the coefficients ϕi, for i=1,2,,q.
The next ip elements must contain the moving average coefficients βi, for i=1,2,,p.
If dist="T", the next element must contain an estimate for 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 copts=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 and the next iq elements contain the coefficients αi, for i=1,2,,q.
The next iq elements contain the coefficients ϕi, for i=1,2,,q.
The next ip elements are the moving average coefficients βi, for i=1,2,,p.
If dist="T", the next element contains an estimate for df then 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.
se
Type: array<System..::..Double>[]()[][]
An array of size [npar]
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 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 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.
sc
Type: array<System..::..Double>[]()[][]
An array of size [npar]
On exit: the scores for θ^.
The first element contains the scores for αo, the next iq elements contain the scores for αi, for i=1,2,,q, the next iq elements contain the scores for ϕi, for i=1,2,,q, the next ip elements are the scores for βj, for j=1,2,,p.
If dist="T", the next element contains the scores 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.
covr
Type: array<System..::..Double,2>[,](,)[,][,]
An array of size [dim1, npar]
Note: dim1 must satisfy the constraint: dim1npar
On exit: the covariance matrix of the parameter estimates θ^, that is the inverse of the Fisher Information Matrix.
hp
Type: System..::..Double%
On entry: if copts=false then hp is the value to be used for the pre-observed conditional variance, otherwise hp is not referenced.
On exit: if copts=true then hp is the estimated value of the pre-observed conditional variance.
et
Type: array<System..::..Double>[]()[][]
An array of size [num]
On exit: the estimated residuals, εt, for t=1,2,,T.
ht
Type: array<System..::..Double>[]()[][]
An array of size [num]
On exit: the estimated conditional variances, ht, for t=1,2,,T.
lgf
Type: System..::..Double%
On exit: the value of the log-likelihood function at θ^.
copts
Type: System..::..Boolean
On entry: if copts=true, the method provides initial parameter estimates of the regression terms, otherwise these are provided by you.
maxit
Type: System..::..Int32
On entry: the maximum number of iterations to be used by the optimization method when estimating the GARCHp,q parameters.
Constraint: maxit>0.
tol
Type: System..::..Double
On entry: the tolerance to be used by the optimization method when estimating the GARCHp,q parameters.
ifail
Type: System..::..Int32%
On exit: ifail=0 unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).

Description

A univariate regression-exponential GARCHp,q process, with q coefficients αi, for i=1,2,,q, 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+xtTb+εtlnht=α0+i=1qαizt-i+i=1qϕizt-i-Ezt-i+i=1pβilnht-i,  t=1,2,,T (1)
where zt=εtht, Ezt-i denotes the expected value of zt-i and ε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.
g13fg provides an estimate θ^, for the vector θ=bo,bT,ωT where bT=b1,,bk, ωT=α0,α1,,αq,ϕ1,,ϕq,β1,,βp,γ when dist="N", and ωT=α0,α1,,αq,ϕ1,,ϕq,β1,,βp,γ,df when dist="T".
mn, nreg can be used to simplify the GARCHp,q expression in (1) as follows:
No Regression and No Mean
  • yt=εt,
  • mn=0,
  • nreg=0 and
  • θ is a 2×q+p+1 vector when dist="N", and a 2×q+p+2 vector, when dist="T".
No Regression
  • yt=bo+εt,
  • mn=1,
  • nreg=0 and
  • θ is a 2×q+p+2 vector when dist="N" and a 2×q+p+3 vector, when dist="T".
Note:  if the yt=μ+εt, where μ is known (not to be estimated by g13fg) 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=xtTb+εt,
  • mn=0,
  • nreg=k and
  • θ is a 2×q+p+1+k vector when dist="N" and a 2×q+p+2+k vector, when dist="T".

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

Error Indicators and Warnings

Note: g13fg may return useful information for one or more of the following detected errors or warnings.
Errors or warnings detected by the method:
Some error messages may refer to parameters that are dropped from this interface (LDX, LDCOVR) In these cases, an error in another parameter has usually caused an incorrect value to be inferred.
ifail=1
On entry,nreg<0,
ormn>1,
ormn<0,
oriq<1,
orip<0,
ornpar20,
ornpar has an invalid value,
ordist"N",
ordist"T",
ormaxit0,
ornum<maxip,iq,
ornum<nreg+mn.
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.
ifail=-9000
An error occured, see message report.
ifail=-6000
Invalid Parameters value
ifail=-4000
Invalid dimension for array value
ifail=-8000
Negative dimension for array value
ifail=-6000
Invalid Parameters value

Accuracy

Not applicable.

Parallelism and Performance

None.

Further Comments

None.

Example

This example fits a GARCH1,2 model with Student's t-distributed residuals to some simulated data.

Example program (C#): g13fge.cs

Example program data: g13fge.d

Example program results: g13fge.r

See Also