garch class

Create GARCH time series model object

Description

garch creates model objects for generalized autoregressive conditional heteroscedastic (GARCH) models. The GARCH(P,Q) conditional variance model includes P lagged conditional variances and Q lagged squared innovations.

Create model objects with known or unknown coefficients. Estimate unknown coefficients from data using estimate.

Construction

model = garch creates a conditional variance GARCH model of degrees zero.

model = garch(P,Q) creates a conditional variance GARCH model with GARCH degree P and ARCH degree Q.

model = garch(Name,Value) creates a GARCH model with additional options specified by one or more Name,Value pair arguments. Name can also be a property name and Value is the corresponding value. Name must appear inside single quotes (''). You can specify several name-value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Input Arguments

P

Nonnegative integer indicating the number of lagged conditional variances included in the GARCH model.

You cannot use this argument in conjunction with name-value pair arguments.

Q

Nonnegative integer indicating the number of lagged squared innovations included in the GARCH model. If P is greater than zero, then Q must also be greater than zero.

You cannot use this argument in conjunction with name-value pair arguments.

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

'Constant'

Positive scalar constant in the GARCH model.

Default: NaN

'GARCH'

Cell vector of nonnegative conditional variance coefficients. When specified without GARCHLags, GARCH is a P-element cell vector of coefficients at lags 1, 2,...,P. When specified with GARCHLags, GARCH is an equivalent-length cell vector of coefficients associated with the lags in GARCHLags.

Default: Cell vector of NaNs.

'ARCH'

Cell vector of nonnegative squared innovation coefficients. When specified without ARCHLags, ARCH is a Q-element cell vector of coefficients at lags 1, 2,...,Q. When specified with ARCHLags, ARCH is an equivalent-length cell vector of coefficients associated with the lags in ARCHLags.

Default: Cell vector of NaNs.

'Offset'

Scalar offset, or additive constant, associated with an innovation mean model.

Default: 0

'GARCHLags'

Vector of positive integer lags associated with the GARCH coefficients.

Default: Vector of integers 1, 2,...,P.

'ARCHLags'

Vector of positive integer lags associated with the ARCH coefficients.

Default: Vector of integers 1, 2,...,Q.

'Distribution'

Conditional probability distribution of the innovation process. Distribution is a string you specify as 'Gaussian' or 't'. Alternatively, specify it as a data structure with the field Name to store the distribution 'Gaussian' or 't'. If the distribution is 't', then the structure also needs the field DoF to store the degrees of freedom.

Default: 'Gaussian'

    Note:   Each GARCH and ARCH coefficient is associated with an underlying lag operator polynomial and is subject to a near-zero tolerance exclusion test. That is, each coefficient is compared to the default lag operator zero tolerance, 1e-12. A coefficient is only included in the model if its magnitude is greater than 1e-12. Otherwise, it is considered sufficiently close to zero and excluded from the model. See LagOp for additional details.

Properties

P

Number of presample conditional variances needed to initialize the model. This is equal to the largest lag corresponding to a nonzero conditional variance coefficient.

You can only specify this property when using the garch(P,Q) syntax. If you use the name-value syntax, garch automatically sets the property P equal to the largest lag in GARCHLags. If GARCHLags is not specified, garch sets P equal to the number of elements in GARCH.

You cannot modify this property.

Q

Number of presample innovations needed to initialize the model. This is equal to the largest lag corresponding to a nonzero squared innovation coefficient.

You can only specify this property when using the garch(P,Q) syntax. If you use the name-value syntax, garch automatically sets the property Q equal to the largest lag in ARCHLags. If ARCHLags is not specified, garch sets Q equal to the number of elements in ARCH.

You cannot modify this property.

Constant

Scalar constant in the GARCH model.

GARCH

Cell vector of coefficients corresponding to the lagged conditional variance terms.

ARCH

Cell vector of coefficients corresponding to the lagged squared innovation terms.

UnconditionalVariance

Unconditional variance of the process,

σε2=κ(1i=1Pγij=1Qαj).

This property is read-only.

Offset

Additive constant associated with an innovation mean model.

Distribution

Data structure for the conditional probability distribution of the innovation process. The field Name stores the distribution name 'Gaussian' or 't'. If the distribution is 't', then the structure also has the field DoF to store the degrees of freedom.

Methods

estimateEstimate GARCH model parameters
filterFilter disturbances with GARCH model
forecastForecast GARCH process
inferInfer GARCH model conditional variances
printDisplay parameter estimation results for GARCH models
simulateMonte Carlo simulation of GARCH models

Definitions

GARCH Model

Consider a time series yt with a constant mean offset,

yt=μ+εt,

where εt=σtzt. The GARCH(P,Q) conditional variance process, σt2, is of the form

σt2=κ+γ1σt12++γPσtP2+α1εt12++αQεtQ2.

  • The additive constant μ corresponds to the name-value argument Offset.

  • The constant κ > 0 corresponds to the name-value argument Constant.

  • The coefficients γi0 correspond to the name-value pair GARCH.

  • The coefficients αj0 correspond to the name-value pair ARCH.

  • The toolbox enforces stationarity with the constraint

    i=1Pγi+j=1Qαj<1.

Copy Semantics

Value. To learn how value classes affect copy operations, see Copying Objects in the MATLAB® documentation.

Examples

expand all

Specify a GARCH Model with Unknown Coefficients

Use the shorthand syntax to create a GARCH(2,1) model object with unknown coefficients.

model = garch(2,1)
model = 

    GARCH(2,1) Conditional Variance Model:
    --------------------------------------  
    Distribution: Name = 'Gaussian'
               P: 2
               Q: 1
        Constant: NaN
           GARCH: {NaN NaN} at Lags [1 2]
            ARCH: {NaN} at Lags [1]

When you use the shorthand syntax, garch assigns default values to all properties. NaN values indicate unknown parameters in the model.

Specify a GARCH Model with Known Coefficients

Specify a GARCH(1,1) model with mean offset,

$${y_t} = 0.5 + {\varepsilon _t},$$

where ${\varepsilon _t} = {\sigma _t}{z_t},$,

$$\sigma _t^2 = 0.0001 + 0.75\sigma _{t - 1}^2 + 0.1\varepsilon _{t - 1}^2,$$

and $z_{t}$ is an independent and identically distributed standard Gaussian process.

model = garch('Constant',0.0001,'GARCH',0.75,...
					'ARCH',0.1,'Offset',0.5)
model = 

    GARCH(1,1) Conditional Variance Model with Offset:
    --------------------------------------------------  
    Distribution: Name = 'Gaussian'
               P: 1
               Q: 1
        Constant: 0.0001
           GARCH: {0.75} at Lags [1]
            ARCH: {0.1} at Lags [1]
          Offset: 0.5

garch assigns default values to any properties you do not specify with name-value pair arguments.

Modify a garch Model Object

Specify a GARCH model, and then modify the created model object.

Specify the GARCH(1,1) model from the previous example.

model = garch('Constant',0.0001,'GARCH',0.75,...
					'ARCH',0.1,'Offset',0.5);

Change the GARCH coefficient to 0.6.

model.GARCH = {0.6}
model = 

    GARCH(1,1) Conditional Variance Model with Offset:
    --------------------------------------------------  
    Distribution: Name = 'Gaussian'
               P: 1
               Q: 1
        Constant: 0.0001
           GARCH: {0.6} at Lags [1]
            ARCH: {0.1} at Lags [1]
          Offset: 0.5

The output display shows the updated GARCH coefficient.

Change the conditional innovation distribution to a Student's $t$ distribution with eight degrees of freedom.

model.Distribution = struct('Name','t','DoF',8)
model = 

    GARCH(1,1) Conditional Variance Model with Offset:
    --------------------------------------------------  
    Distribution: Name = 't', DoF = 8
               P: 1
               Q: 1
        Constant: 0.0001
           GARCH: {0.6} at Lags [1]
            ARCH: {0.1} at Lags [1]
          Offset: 0.5

The Distribution data structure now has two fields.

Add a second lagged conditional variance term with GARCH coefficient 0.1.

model.GARCH{2} = 0.1
model = 

    GARCH(2,1) Conditional Variance Model with Offset:
    --------------------------------------------------  
    Distribution: Name = 't', DoF = 8
               P: 2
               Q: 1
        Constant: 0.0001
           GARCH: {0.6 0.1} at Lags [1 2]
            ARCH: {0.1} at Lags [1]
          Offset: 0.5

There are now two GARCH coefficients at lags 1 and 2.

Was this topic helpful?