Accelerating the pace of engineering and science

# gjr class

Create GJR time series model object

## Description

gjr creates model objects for GJR models. The GJR model is a variant of the GARCH conditional variance model, named for Glosten, Jagannathan, and Runkle [1]. The GJR(P,Q) model includes P lagged conditional variances, Q lagged squared innovations, and Q leverage terms.

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

## Construction

model = gjr creates a conditional variance GJR model of degrees zero.

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

model = gjr(Name,Value) creates a GJR 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 GJR 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 GJR 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 GJR 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 with the same length as GARCHLags. 'ARCH' Cell vector of nonnegative squared innovation coefficients. When specified without ARCHLags, ARCH is cell vector of coefficients at lags 1, 2,... to the number of ARCH coefficients in the model. When specified with ARCHLags, ARCH is an equivalent-length cell vector of coefficients associated with the lags in ARCHLags. Default: Cell vector of NaNs with the same length as ARCHLags. 'Leverage' Cell vector of coefficients associated with past sign-weighted squared innovations. When specified without LeverageLags, Leverage is a cell vector of coefficients at lags 1, 2,... to the number of leverage coefficients in the model. When specified with LeverageLags, Leverage is an equivalent-length cell vector of coefficients associated with the lags in LeverageLags. Default: Cell vector of NaNs with the same length as LeverageLags. '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,... to the number of ARCH coefficients. 'LeverageLags' Vector of positive integer lags associated with the leverage coefficients. Default: Vector of integers 1, 2,... to the number of leverage coefficients. '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'
 Notes:   Each GARCH, ARCH and Leverage 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.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. In other words, the lengths of ARCH and Leverage might differ.

## Properties

 P Number of presample conditional variances needed to initiate 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 gjr(P,Q) syntax. If you use the name-value syntax, gjr automatically sets the property P equal to the largest lag in GARCHLags. If GARCHLags is not specified, gjr 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 gjr(P,Q) syntax. If you use the name-value syntax, gjr automatically sets the property Q equal to the largest lag with a nonzero squared innovation coefficient, including ARCH and leverage coefficients and the corresponding lags in ARCHLags and LeverageLags. You cannot modify this property. Constant Scalar constant in the GJR 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,${\sigma }_{\epsilon }^{2}=\frac{\kappa }{\left(1-{\sum }_{i=1}^{P}{\gamma }_{i}-{\sum }_{j=1}^{Q}{\alpha }_{j}-\frac{1}{2}{\sum }_{j=1}^{Q}{\xi }_{j}\right)}.$This property is read-only. Leverage Cell vector of coefficients corresponding to the lagged leverage terms. 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

 estimate Estimate GJR model parameters filter Filter disturbances with GJR model forecast Forecast GJR process infer Infer GJR model conditional variances print Display parameter estimation results for GJR models simulate Monte Carlo simulation of GJR models

## Definitions

### GJR Model

Consider a time series yt with a constant mean offset,

${y}_{t}=\mu +{\epsilon }_{t},$

where ${\epsilon }_{t}={\sigma }_{t}{z}_{t}.$ The GJR(P,Q) conditional variance process, ${\sigma }_{t}^{2}$, is of 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},$

where $I\left[{\epsilon }_{t-j}<0\right]=1$ if ${\epsilon }_{t-j}<0,$ and 0 otherwise.

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

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

• The coefficients ${\gamma }_{i}\ge 0$ correspond to the name-value argument GARCH.

• The coefficients ${\alpha }_{j}\ge 0$ correspond to the name-value argument ARCH.

• The coefficients ${\xi }_{j}$ correspond to the name-value argument Leverage.

• The distribution of zt (the innovation distribution) corresponds to the name-value argument Distribution, and can be Gaussian or Student's t.

• gjr enforces the constraint ${A}_{j}+{L}_{j}\ge 0.$

• gjr enforces stationarity with the constraint

$\sum _{i=1}^{P}{\gamma }_{i}+\sum _{j=1}^{Q}{\alpha }_{j}+\frac{1}{2}\sum _{j=1}^{Q}{\xi }_{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 GJR Model with Unknown Coefficients

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

model = gjr(1,1)

model =

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]


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

### Specify a GJR Model with Known Coefficients

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

where

and is an independent and identically distributed standard Gaussian process.

model = gjr('Offset',0.2,'Constant',0.001,...
'GARCH',0.6,'ARCH',0.3,'Leverage',0.1)

model =

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


gjr assigns default values to the properties P and Q.

### Modify a gjr Model Object

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

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

model = gjr('Offset',0.2,'Constant',0.001,...
'GARCH',0.6,'ARCH',0.3,'Leverage',0.1);


Change the GARCH coefficient to 0.5.

model.GARCH = {0.5}

model =

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


The output display shows the updated GARCH coefficient.

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

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

model =

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


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 =

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


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

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

## More About

Was this topic helpful?