g13fe estimates the parameters of a univariate regression-GJR GARCHp,q process (see Glosten et al. (1993)).

Syntax

C#
public static void g13fe(
	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 g13fe ( _
	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 g13fe(
	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, 
	array<bool>^ copts, 
	int maxit, 
	double tol, 
	[OutAttribute] int% ifail
)
F#
static member g13fe : 
        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=2+iq+ip+mn+nreg when dist="N" and npar=3+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 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 contains 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[1]=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 moving average 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.
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 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.
sc
Type: array<System..::..Double>[]()[][]
An array of size [npar]
On exit: the scores for θ^.
The first element contains the score for αo, the next iq elements contain the scores for αi, for i=1,2,,q.
The next ip elements are the score 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.
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[1]=false, hp is the value to be used for the pre-observed conditional variance; otherwise hp is not referenced.
On exit: if copts[1]=true, 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: array<System..::..Boolean>[]()[][]
An array of size [2]
On entry: the options to be used by g13fe.
copts[0]=true
Stationary conditions are enforced, otherwise they are not.
copts[1]=true
The method provides initial parameter estimates of the regression terms, otherwise these are to be 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. 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.
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-GJR GARCHp,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+xtTb+εt (1)
ht=α0+i=1qαi+γIt-iεt-i2+i=1pβiht-i,  t=1,2,,T (2)
where It=1, if εt<0, It=0, if εt0, 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 is the conditional variance, and ψt the set of all information up to time t.
g13fe 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, 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 p+q+2 vector when dist="N", and a p+q+3 vector when dist="T".
No Regression
  • yt=bo+εt,
  • mn=1,
  • nreg=0 and
  • θ is a p+q+3 vector when dist="N", and a p+q+4 vector when dist="T".
Note:  if the yt=μ+εt, where μ is known (not to be estimated by g13fe) 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 p+q+k+2 vector when dist="N", and a p+q+k+3 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: g13fe 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",
ormaxit<0,
ornum<maxip,iq,
ornum<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.
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,1 model with Student's t-distributed residuals to some simulated data.

Example program (C#): g13fee.cs

Example program data: g13fee.d

Example program results: g13fee.r

See Also