# Documentation

## GJR Model Specifications

### Default GJR Model

This example shows how to use the shorthand gjr(P,Q) syntax to specify the default GJR(P, Q) model, with a Gaussian innovation distribution and

By default, all parameters in the created model have unknown values.

Specify the default GJR(1,1) model:

Mdl = gjr(1,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] 

The output shows that the created model, Mdl, has NaN values for all model parameters: the constant term, the GARCH coefficient, the ARCH coefficient, and the leverage coefficient. You can modify the created model using dot notation, or input it (along with data) to estimate.

### GJR Model with a Mean Offset

This example shows how to specify a GJR(P, Q) model with a mean offset. Use name-value pair arguments to specify a model that differs from the default model.

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

where and

Mdl = gjr('Offset',NaN,'GARCHLags',1,'ARCHLags',1,... 'LeverageLags',1) 
Mdl = GJR(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] Leverage: {NaN} at Lags [1] Offset: NaN 

The mean offset appears in the output as an additional parameter to be estimated or otherwise specified.

### GJR Model with Nonconsecutive Lags

This example shows how to specify a GJR model with nonzero coefficients at nonconsecutive lags.

Specify a GJR(3,1) model with nonzero GARCH terms at lags 1 and 3. Include a mean offset.

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

The unknown nonzero GARCH coefficients correspond to lagged variances at lags 1 and 3. The output shows only the nonzero coefficients.

Display the value of GARCH:

Mdl.GARCH 
ans = [NaN] [0] [NaN] 

The GARCH cell array returns three elements. The first and third elements have value NaN, indicating these coefficients are nonzero and need to be estimated or otherwise specified. By default, gjr sets the interim coefficient at lag 2 equal to zero to maintain consistency with MATLAB® cell array indexing.

### GJR Model with Known Parameter Values

This example shows how to specify a GJR model with known parameter values. You can use such a fully specified model as an input to simulate or forecast.

Specify the GJR(1,1) model

with a Gaussian innovation distribution.

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

Because all parameter values are specified, the created model has no NaN values. The functions simulate and forecast don't accept input models with NaN values.

### GJR Model with a t Innovation Distribution

This example shows how to specify a GJR model with a Student's t innovation distribution.

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

where and

Assume follows a Student's t innovation distribution with 10 degrees of freedom.

tDist = struct('Name','t','DoF',10); Mdl = gjr('Offset',NaN,'GARCHLags',1,'ARCHLags',1,... 'LeverageLags',1,'Distribution',tDist) 
Mdl = GJR(1,1) Conditional Variance Model with Offset: -------------------------------------------------- Distribution: Name = 't', DoF = 10 P: 1 Q: 1 Constant: NaN GARCH: {NaN} at Lags [1] ARCH: {NaN} at Lags [1] Leverage: {NaN} at Lags [1] Offset: NaN 

The value of Distribution is a struct array with field Name equal to 't' and field DoF equal to 10. When you specify the degrees of freedom, they aren't estimated if you input the model to estimate.