garchGJRFit#

Purpose#

Estimates asymmetric GJR-GARCH model.

Library#

tsmt

Format#

gOut = garchGJRFit(y, p [, q, gctl]);
gOut = garchGJRFit(y, p [, q, gctl]);
gOut = garchGJRFit(dataset, formula, p [, q, gctl]);
Parameters:
  • y (Matrix) – dependent variables.

  • x (Matrix) – independent variables.

  • dataset (string) – name of data set or null string.

  • formula (string) – formula string of the model. E.g. "y ~ X1 + X2" ‘y’ is the name of dependent variable, ‘X1’ and ‘X2’ are names of independent variables; E.g. "y ~ ." , ‘.’ means including all variables except dependent variable ‘y’;

  • p (scalar) – order of the GARCH parameters.

  • q (scalar) – Optional input. order of the ARCH parameters.

  • gctl

    Optional input. garchControl structure.

    gctl.density

    scalar, density of error term:

    0

    Normal distribution. (Default)

    1

    Student’s t-distribution.

    3

    Skew generalized t-distribution.

    gctl.asymmetry

    scalar, if nonzero assymetry terms are added. (Default = 0)

    gctl.inmean

    scalar, GARCH-in-mean, square root of conditional variance is included in the mean equation.

    gctl.stConstraintsType

    scalar, type of enforcement of stationarity requirements:

    1

    Roots of characteristic polynomial constrained outside unit circle. (Default)

    2

    ARCH, GARCH parameters constrained to sum to less than one and greater than zero.

    3

    None.

    gctl.cvConstraintsType

    scalar, type of enforcement of nonnegative conditional variances:

    0

    Direct constraints. (Default)

    1

    Nelson & Cao constraints.

    gctl.covType

    scalar, type of covariance matrix of parameters:

    1

    Maximum Likelihood. (Default)

    2

    Quasi-Maximum Likelihood. (Default)

    3

    None.

    gctl.sqpsolvemtControlProc

    function pointer, pointer to a function that updates optimization settings by setting the sqpsolvemtControl structure members.

    gctl.cmlmtControlProc

    function pointer, pointer to a function that updates optimization settings by setting the cmlmtControl structure members.

    gctl.start

    PV structure, estimation starting values.

Returns:

gOut (struct) –

garchEstimation structure containing the following members:

gout.aic

scalar, Akiake criterion.

gout.bic

scalar, Bayesian information criterion.

gout.lrs

scalar, likelihood ratio statistic.

gout.numObs

scalar, number of observations.

gout.df

scalar, degrees of freedom.

gout.par

instance of PV structure containing parameter estimates.

gout.retcode

scalar, return code:

1

Normal convergence.

2

Forced exit.

3

Function calculation failed.

4

Gradient calculation failed.

5

Hessian calculation failed.

6

Line search failed.

7

Error with constraints.

8

Function complex.

gout.moment

KxK matrix, moment matrix of parameter estimates.

gout.climits

Kx2 matrix, confidence limits.

gout.tsmtDesc

An instance of the tsmtModelDesc structure containing the following members:

tsmtDesc.depvar

Kx1 string array, names of endogenous variables.

tsmtDesc.indvars

Mx1 string array, names of exogenous variables.

tsmtDesc.timespan

2x1 string array, range of the time series. Available if date vector is passed as part of a dataframe input.

tsmtDesc.ncases

Scalar, number of observations.

tsmtDesc.df

Scalar, degrees of freedom.

tsmtDesc.model_name

String, model name.

gout.sumStats

An instance of the tsmtSummaryStats structure containing the following members:

sumStats.sse

Vector, sum of the squared errors of estimates for endogenous variables in the model.

sumStats.mse

Vector, mean squared errors of estimates for endogenous variables in the model.

sumStats.rmse

Vector, root mean squared errors of estimates for endogenous variables in the model.

sumStats.see

Vector, standard error of the estimates for endogenous variables in the model.

sumStats.rsq

Vector, r-squared of estimates for endogenous variables in the model.

sumStats.AdjRsq

Scalar, adjusted r-squared of estimates for endogenous variables in the model.

sumStats.ssy

Scalar, total sum of the squares for endogenous variables in the model.

sumStats.DW

Scalar, Durbin-Watson statistic for residuals from the estimates for endogenous variables in the model.

Example#

new;
cls,;
library tsmt;

y = loadd( getGAUSSHome("pkgs/tsmt/examples/gjrgarch_data.gdat"));

// GARCH control structure
struct garchControl gctl;
gctl = garchControlCreate;

// Set pointer to function to
// control optimization settings
gctl.sqpsolvemtControlproc = &prc;

// Set covariance type to be
// Quasi-Maximum Likelihood
gctl.covtype = 2;

// Control sqpSolveMT optimization
proc prc(struct sqpSolveMTControl c0);
    c0.printiters = 10;
    retp(c0);
endp;

// GARCH order
p = 1;

// ARCH order
q = 1;

// Estimate model
struct garchEstimation gOut;
gOut = garchgjrFit(y, p, q, gCtl);

This prints the following output:

================================================================================
Model:               GJR-GARCH(1,1)          Dependent variable:               Y
Time Span:              1980-01-20:          Valid cases:                   1000
                        1982-10-15
================================================================================
                             Coefficient            Upper CI            Lower CI

        beta0[1,1]               0.01089             0.00323             0.01855
        garch[1,1]               0.11990            -0.15034             0.39015
         arch[1,1]               0.10397             0.01426             0.19367
          tau[1,1]               0.21660             0.07062             0.36259
        omega[1,1]               0.01100             0.00694             0.01506
================================================================================

              AIC:                                                  1316.65106
              LRS:                                                  1306.65106

Source#

tsgarch.src

See also

Functions garchFit(), garchMFit(), igarchFit()