# Documentation

### This is machine translation

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

# gjr

Create GJR conditional variance model object

Create a `gjr` model object to represent a Glosten, Jagannathan, and Runkle (GJR) model. The GJR(P,Q) conditional variance model includes P past conditional variances composing the GARCH polynomial, and Q past squared innovations composing the ARCH and leverage polynomials.

Use `gjr` 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 `gjr` model objects, see `gjr`.

## Syntax

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

## Description

example

````Mdl = gjr` creates a zero-degree conditional variance GJR model object.```

example

````Mdl = gjr(P,Q)` creates a GJR model with GARCH polynomial degree `P`, and ARCH and leverage polynomials having degree `Q`.```

example

````Mdl = gjr(Name,Value)` creates a GJR 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 `gjr` model object and specify its parameter values using dot notation.

Create a GJR(0,0) model.

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

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

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

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

The `Q`, `ARCH`, and `Leverage` properties update to `2`, `{NaN NaN}`, and `{NaN NaN}`, respectively. The two ARCH and leverage coefficients are associated with lags 1 and 2.

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

Create an GJR(3,2) model.

`Mdl = gjr(3,2)`
```Mdl = GJR(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] Leverage: {NaN NaN} at Lags [1 2] ```

`Mdl` is a `gjr` 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 GARCH polynomial up to lags `P`

• Includes all lag terms in the ARCH and leverage polynomials up to lag `Q`

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

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

Specify a GJR(1,1) model.

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

`Mdl` is a `gjr` model object. The software sets all parameters to `NaN`, except `P`, `Q`, `Distribution`, and `Offset` (which is `0` by default).

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 GJR Model.

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

where

and is an independent and identically distributed standard Gaussian process.

```Mdl = gjr('Constant',0.0001,'GARCH',0.35,... 'ARCH',0.1,'Offset',0.5,'Leverage',{0.03 0 0.01})```
```Mdl = GJR(1,3) Conditional Variance Model with Offset: -------------------------------------------------- Distribution: Name = 'Gaussian' P: 1 Q: 3 Constant: 0.0001 GARCH: {0.35} at Lags [1] ARCH: {0.1} at Lags [1] Leverage: {0.03 0.01} at Lags [1 3] Offset: 0.5 ```

`gjr` assigns default values to any properties you do not specify with name-value pair arguments. An alternative way to specify the leverage component is `'Leverage',{0.03 0.01},'LeverageLags',[1 3]`.

## 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 `gjr``(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: `gjr(3,2)`

Data Types: `double`

Number of past consecutive squared innovation terms to include in the ARCH and leverage polynomials, specified as a nonnegative integer. That is, `Q` is the degrees of the ARCH and leverage polynomials, where each 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 when using the `gjr``(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: `gjr(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 GJR 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 `ARCH`. Otherwise, `ARCH` is a Q-element cell vector of coefficients corresponding to lags 1 through the number of elements in `ARCH`.

The coefficients must compose a stationary model. For details, see GJR 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`

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

If you specify `LeverageLags`, then `Leverage` is an equivalent-length cell vector of coefficients associated with the lags in `ARCHLags`. Otherwise, `Leverage` is a cell vector of coefficients corresponding to lags 1 through the number of elements in `Leverage`.

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

By default, `Leverage` is a cell vector of `NaN`s with the same length as the leverage polynomial degree or `numel(LeverageLags)`.

Example: `'Leverage',{-0.1 0 0 0.03}`

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 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 the ARCH polynomial degree.

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

Data Types: `double`

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

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

By default, `LeverageLags` is a vector containing the integers 1 through the leverage polynomial degree.

Example: `'LeverageLags',1:4`

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`

### Notes:

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

1. Creates lag operator polynomials for each of the `GARCH`, `ARCH` and `Leverage` 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`.

• The lengths of `ARCH` and `Leverage` might differ. The difference can occur because the software defines the property `Q` as the largest lag associated with nonzero `ARCH` and `Leverage` coefficients, or `max(ARCHLags,LeverageLags)`. Typically, the number and corresponding lags of nonzero `ARCH` and `Leverage` coefficients are equivalent, but this is not a requirement.

## Output Arguments

collapse all

GJR model, returned as a `gjr` 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

### GJR Model

The Glosten, Jagannathan, and Runkle (GJR) model is a generalization of the GARCH model that is appropriate for modelling asymmetric volatility clustering [1]. Specifically, the model posits that the current conditional variance is the sum of these linear processes, with coefficients:

• Past conditional variances (the GARCH component or polynomial).

• Past squared innovations (the ARCH component or polynomial).

• Past squared, negative innovations (the leverage component or polynomial).

Consider the time series

`${y}_{t}=\mu +{\epsilon }_{t},$`
where ${\epsilon }_{t}={\sigma }_{t}{z}_{t}.$ The GJR(P,Q) conditional variance process, ${\sigma }_{t}^{2}$, has the form
`${\sigma }_{t}^{2}=\kappa +\sum _{i=1}^{P}{\gamma }_{i}{\sigma }_{t-i}^{2}+\sum _{j=1}^{Q}{\alpha }_{j}{\epsilon }_{t-j}^{2}+\sum _{j=1}^{Q}{\xi }_{j}I\left[{\epsilon }_{t-j}<0\right]{\epsilon }_{t-j}^{2}.$`
The table shows how the variables correspond to the properties of the `garch` model object. In the table, I[x < 0] = 1, and 0 otherwise.

VariableDescriptionProperty
μInnovation mean model constant offset`'Offset'`
κ > 0Conditional variance model constant`'Constant'`
γjGARCH component coefficients`'GARCH'`
αjARCH component coefficients`'ARCH'`
ξjLeverage component coefficients`'Leverage'`
ztSeries of independent random variables with mean 0 and variance 1`'Distribution'`

For stationarity and positivity, GJR 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$

• ${\alpha }_{j}+{\xi }_{j}\ge 0$

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

GJR models are appropriate when negative shocks of contribute more to volatility than positive shocks [2].

If all leverage coefficients are zero, then the GJR model reduces to the GARCH model. Because the GARCH model is nested in the GJR model, you can use likelihood ratio tests to compare a GARCH model fit against a GJR model fit.

## References

[1] Glosten, L. R., R. Jagannathan, and D. E. Runkle. “On the Relation between the Expected Value and the Volatility of the Nominal Excess Return on Stocks.” The Journal of Finance. Vol. 48, No. 5, 1993, pp. 1779–1801.

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