# Documentation

### This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English verison of the page.

# garch

Create GARCH conditional variance model object

Create a `garch` model object to represent a generalized autoregressive conditional heteroscedastic (GARCH) model. The GARCH(P,Q) conditional variance model includes P past conditional variances composing the GARCH polynomial, and Q past squared innovations composing the ARCH polynomial.

Use `garch` to create a model with known or unknown coefficients, and then estimate any unknown coefficients from data using `estimate`. You can also simulate or forecast conditional variances from fully specified models using `simulate` or `forecast`, respectively.

For more information about `garch` model objects, see `garch`.

## Syntax

``Mdl = garch``
``Mdl = garch(P,Q)``
``Mdl = garch(Name,Value)``

## Description

example

````Mdl = garch` creates a zero-degree conditional variance GARCH model object.```

example

````Mdl = garch(P,Q)` creates a GARCH model with GARCH polynomial degree `P` and ARCH polynomial degree `Q`.```

example

````Mdl = garch(Name,Value)` creates a GARCH model with additional options specified by one or more `Name,Value` pair arguments. For example, you can specify a conditional variance model constant, the number of ARCH polynomial lags, and the innovation distribution.```

## Examples

collapse all

Create a default `garch` model object and specify its parameter values using dot notation.

Create a GARCH(0,0) model.

`Mdl = garch`
```Mdl = GARCH(0,0) Conditional Variance Model: -------------------------------------- Distribution: Name = 'Gaussian' P: 0 Q: 0 Constant: NaN GARCH: {} ARCH: {} ```

`Mdl` is a `garch` model. It contains an unknown constant, its offset is `0`, and the innovation distribution is `'Gaussian'`. The model does not have a GARCH or ARCH polynomial.

Specify two unknown ARCH coefficients for lags one and two using dot notation.

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

The `Q` and `ARCH` properties are updated to `2` and `{NaN NaN}`. The two ARCH coefficients are associated with lags 1 and 2.

Create a `garch` model using the shorthand notation `garch(P,Q)`, where `P` is the degree of the GARCH polynomial and `Q` is the degree of the ARCH polynomial.

Create a GARCH(3,2) model.

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

`Mdl` is a `garch` model object. All properties of `Mdl`, except `P`, `Q`, and `Distribution`, are `NaN` values. By default, the software:

• Includes a conditional variance model constant

• Excludes a conditional mean model offset (i.e., the offset is `0`)

• Includes all lag terms in the ARCH and GARCH lag-operator polynomials up to lags `Q` and `P`, respectively

`Mdl` specifies only the functional form of a GARCH model. Because it contains unknown parameter values, you can pass `Mdl` and the time-series data to `estimate` to estimate the parameters.

Create a `garch` model using name-value pair arguments.

Specify a GARCH(1,1) model. By default, the conditional mean model offset is zero. Specify that the offset is `NaN`.

`Mdl = garch('GARCHLags',1,'ARCHLags',1,'Offset',NaN)`
```Mdl = GARCH(1,1) Conditional Variance Model with Offset: -------------------------------------------------- Distribution: Name = 'Gaussian' P: 1 Q: 1 Constant: NaN GARCH: {NaN} at Lags [1] ARCH: {NaN} at Lags [1] Offset: NaN ```

`Mdl` is a `garch` model object. The software sets all parameters (the properties of the model object) to `NaN`, except `P`, `Q`, and `Distribution`.

Since `Mdl` contains `NaN` values, `Mdl` is only appropriate for estimation only. Pass `Mdl` and time-series data to `estimate`. For a continuation of this example, see Estimate GARCH Model.

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

where

and is an independent and identically distributed standard Gaussian process.

```Mdl = garch('Constant',0.0001,'GARCH',0.75,... 'ARCH',0.1,'Offset',0.5)```
```Mdl = 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.

## Input Arguments

collapse all

Number of past consecutive conditional variance terms to include in the GARCH polynomial, specified as a nonnegative integer. That is, `P` is the degree of the GARCH polynomial, where the polynomial includes each lag term from t – 1 to t`P`. `P` also specifies the minimum number of presample conditional variances the software requires to initiate the model.

You can specify `P` using the `garch``(P,Q)` shorthand syntax only. You cannot specify `P` in conjunction with `Name,Value` pair arguments.

If `P` > 0, then you must specify `Q` as a positive integer.

Example: `garch(3,2)`

Data Types: `double`

Number of past consecutive squared innovation terms to include in the ARCH polynomial, specified as a nonnegative integer. That is, `Q` is the degree of the ARCH polynomial, where the polynomial includes each lag term from t – 1 to t`Q`. `Q` also specifies the minimum number of presample innovations the software requires to initiate the model.

You can specify this property using the `garch``(P,Q)` shorthand syntax only. You cannot specify `Q` in conjunction with `Name,Value` pair arguments.

If `P` > 0, then you must specify `Q` as a positive integer.

Example: `garch(3,2)`

Data Types: `double`

### 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`.

Example: `'Constant',0.5,'ARCHLags',2,'Distribution',struct('Name','t','DoF',5)` specifies a conditional variance model constant of 0.5, two squared innovation terms at lags 1 and 2 of the ARCH polynomial, and a t distribution with 5 degrees of freedom for the innovations.

collapse all

Conditional variance model constant, specified as the comma-separated pair consisting of `'Constant'` and a positive scalar.

Example: `'Constant',0.5`

Data Types: `double`

Coefficients corresponding to the past conditional variance terms that compose the GARCH polynomial, specified as the comma-separated pair consisting of `'GARCH'` and a cell vector of nonnegative scalars.

If you specify `GARCHLags`, then `GARCH` is an equivalent-length cell vector of coefficients associated with the lags in `GARCHLags`. Otherwise, `GARCH` is a P-element cell vector of coefficients corresponding to lags 1, 2,..., P.

The coefficients must compose a stationary model. For details, see GARCH Model.

By default, `GARCH` is a cell vector of `NaN`s of length P (the degree of the GARCH polynomial) or `numel(GARCHLags)`.

Example: `'GARCH',{0.1 0 0 0.02}`

Data Types: `cell`

Coefficients corresponding to the past squared innovation terms that compose the ARCH polynomial, specified as the comma-separated pair consisting of `'ARCH'` and a cell vector of nonnegative scalars.

If you specify `ARCHLags`, then `ARCH` is an equivalent-length cell vector of coefficients associated with the lags in `ARCHLags`. Otherwise, `ARCH` is a Q-element cell vector of coefficients corresponding to lags 1, 2,..., Q.

The coefficients must compose a stationary model. For details, see GARCH Model.

By default, `ARCH` is a cell vector of `NaN`s of length Q (the degree of the ARCH polynomial) or `numel(ARCHLags)`.

Example: `'ARCH',{0.5 0 0.2}`

Data Types: `cell`

Innovation mean model offset or additive constant, specified as the comma-separated pair consisting of `'Offset'` and a scalar.

Example: `'Offset',0.1`

Data Types: `double`

Lags associated with the GARCH polynomial coefficients, specified as the comma-separated pair consisting of `'GARCHLags'` and a vector of positive integers. The maximum value of `GARCHLags` determines P, the GARCH polynomial degree.

If you specify `GARCH`, then `GARCHLags` is an equivalent-length vector of positive integers specifying the lags of the corresponding coefficients in `GARCH`. Otherwise, `GARCHLags` indicates the lags of unknown coefficients in the GARCH polynomial.

By default, `GARCHLags` is a vector containing the integers 1 through P.

Example: `'GARCHLags',[1 2 4 3]`

Data Types: `double`

Lags associated with the ARCH polynomial coefficients, specified as the comma-separated pair consisting of `'ARCHLags'` and a vector of positive integers. The maximum value of `ARCHLags` determines Q, the ARCH polynomial degree.

If you specify `ARCH`, then `ARCHLags` is an equivalent-length vector of positive integers specifying the lags of the corresponding coefficients in `ARCH`. Otherwise, `ARCHLags` indicates the lags of unknown coefficients in the ARCH polynomial.

By default, `ARCHLags` is a vector containing the integers 1 through Q.

Example: `'ARCHLags',[3 1 2]`

Data Types: `double`

Conditional probability distribution of the innovation process, specified as the comma-separated pair consisting of `'Distribution'` and a value in this table.

DistributionValueStructure Array
Gaussian`'Gaussian'``struct('Name','Gaussian')`
Student’s t
 `'t'` By default, `DoF` is `NaN`.
 `struct('Name','t','DoF',DoF)` `DoF` > 2 or `DoF` = `NaN`

Example: `'Distribution',struct('Name','t','DoF',10)`

Data Types: `char` | `struct`

### Note

All `GARCH` and `ARCH` coefficients are subject to a near-zero tolerance exclusion test. That is, the software:

1. Creates lag operator polynomials for each of the `GARCH` and `ARCH` components.

2. Compares each coefficient to the default lag operator zero tolerance, `1e-12`.

3. Includes a coefficient in the model if its magnitude is greater than `1e-12`, and excludes the coefficient otherwise. In other words, the software considers excluded coefficients to be sufficiently close to zero.

For details, see `LagOp`.

## Output Arguments

collapse all

GARCH model, returned as a `garch` model object.

For the property descriptions of `Mdl`, see Conditional Variance Model Properties.

If `Mdl` contains unknown parameters (indicated by `NaN`s), then you can specify them using dot notation. Alternatively, you can pass `Mdl` and time series data to `estimate` to obtain estimates.

If `Mdl` is fully specified, then you can simulate or forecast conditional variances using `simulate` or `forecast`, respectively.

collapse all

### GARCH Model

A GARCH model is an innovations process that addresses conditional heteroscedasticity. Specifically, the model posits that the current conditional variance is the sum of these linear processes, with coefficients for each term:

• Past conditional variances (the GARCH component or polynomial)

• Past squared innovations (the ARCH component or polynomial)

Consider the time series

`${y}_{t}=\mu +{\epsilon }_{t},$`
where ${\epsilon }_{t}={\sigma }_{t}{z}_{t}.$ The GARCH(P,Q) conditional variance process, ${\sigma }_{t}^{2}$, has the form
`${\sigma }_{t}^{2}=\kappa +{\gamma }_{1}{\sigma }_{t-1}^{2}+\dots +{\gamma }_{P}{\sigma }_{t-P}^{2}+{\alpha }_{1}{\epsilon }_{t-1}^{2}+\dots +{\alpha }_{Q}{\epsilon }_{t-Q}^{2}.$`
In lag operator notation, the model is
`$\left(1-{\gamma }_{1}L-\dots -{\gamma }_{P}{L}^{P}\right){\sigma }_{t}^{2}=\kappa +\left({\alpha }_{1}L+\dots +{\alpha }_{Q}{L}^{Q}\right){\epsilon }_{t}^{2}.$`
The table shows how the variables correspond to the properties of the `garch` model object.

VariableDescriptionProperty
μInnovation mean model constant offset`'Offset'`
κ > 0Conditional variance model constant`'Constant'`
${\gamma }_{i}\ge 0$GARCH component coefficients`'GARCH'`
${\alpha }_{j}\ge 0$ARCH component coefficients`'ARCH'`
ztSeries of independent random variables with mean 0 and variance 1`'Distribution'`

For stationarity and positivity, GARCH models use these constraints:

• $\kappa >0$

• ${\gamma }_{i}\ge 0,\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}{\alpha }_{j}\ge 0$

• ${\sum }_{i=1}^{P}{\gamma }_{i}+{\sum }_{j=1}^{Q}{\alpha }_{j}<1$

Engle’s original ARCH(Q) model is equivalent to a GARCH(0,Q) specification.

GARCH models are appropriate when positive and negative shocks of equal magnitude contribute equally to volatility [1].

## References

[1] Tsay, R. S. Analysis of Financial Time Series. 3rd ed. Hoboken, NJ: John Wiley & Sons, Inc., 2010.