## Modify Properties of Conditional Variance Models

### Dot Notation

A model created by `garch`

, `egarch`

, or `gjr`

has values assigned to all model properties. To change any of these property values, you do not need to reconstruct the whole model. You can modify property values of an existing model using dot notation. That is, type the model name, then the property name, separated by `'.'`

(a period).

For example, start with this model specification:

Mdl = garch(1,1)

Mdl = garch with properties: Description: "GARCH(1,1) Conditional Variance Model (Gaussian Distribution)" Distribution: Name = "Gaussian" P: 1 Q: 1 Constant: NaN GARCH: {NaN} at lag [1] ARCH: {NaN} at lag [1] Offset: 0

The default model has no mean offset, so the `Offset`

property does not appear in the model output. The property exists, however:

Offset = Mdl.Offset

Offset = 0

Modify the model to add an unknown mean offset term:

Mdl.Offset = NaN

Mdl = garch with properties: Description: "GARCH(1,1) Conditional Variance Model with Offset (Gaussian Distribution)" Distribution: Name = "Gaussian" P: 1 Q: 1 Constant: NaN GARCH: {NaN} at lag [1] ARCH: {NaN} at lag [1] Offset: NaN

`Offset`

now appears in the model output, with the updated nonzero value.

Be aware that every model property has a data type. Any modifications you make to a property value must be consistent with the data type of the property. For example, `GARCH`

and `ARCH`

(and `Leverage`

for `egarch`

and `gjr`

models) are all cell vectors. This means you must index them using cell array syntax.

For example, start with the following model:

GJRMdl = gjr(1,1)

GJRMdl = gjr with properties: Description: "GJR(1,1) Conditional Variance Model (Gaussian Distribution)" Distribution: Name = "Gaussian" P: 1 Q: 1 Constant: NaN GARCH: {NaN} at lag [1] ARCH: {NaN} at lag [1] Leverage: {NaN} at lag [1] Offset: 0

To modify the property value of `GARCH`

, assign `GARCH`

a cell array. Here, assign known GARCH coefficient values:

GJRMdl.GARCH = {0.6,0.2}

GJRMdl = gjr with properties: Description: "GJR(2,1) Conditional Variance Model (Gaussian Distribution)" Distribution: Name = "Gaussian" P: 2 Q: 1 Constant: NaN GARCH: {0.6 0.2} at lags [1 2] ARCH: {NaN} at lag [1] Leverage: {NaN} at lag [1] Offset: 0

The updated model now has two GARCH terms (at lags 1 and 2) with the specified equality constraints.

Similarly, the data type of `Distribution`

is a data structure. The default data structure has only one field, `Name`

, with value `'Gaussian'`

.

Distribution = GJRMdl.Distribution

`Distribution = `*struct with fields:*
Name: "Gaussian"

To modify the innovation distribution, assign `Distribution`

a new name or data structure. The data structure can have up to two fields, `Name`

and `DoF`

. The second field corresponds to the degrees of freedom for a Student's *t* distribution, and is only required if `Name`

has the value `'t'`

.

To specify a Student's *t* distribution with unknown degrees of freedom, enter:

`GJRMdl.Distribution = 't'`

GJRMdl = gjr with properties: Description: "GJR(2,1) Conditional Variance Model (t Distribution)" Distribution: Name = "t", DoF = NaN P: 2 Q: 1 Constant: NaN GARCH: {0.6 0.2} at lags [1 2] ARCH: {NaN} at lag [1] Leverage: {NaN} at lag [1] Offset: 0

The updated model has a Student's *t* distribution with `NaN`

degrees of freedom. To specify a *t* distribution with eight degrees of freedom, say:

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

GJRMdl = gjr with properties: Description: "GJR(2,1) Conditional Variance Model (t Distribution)" Distribution: Name = "t", DoF = 8 P: 2 Q: 1 Constant: NaN GARCH: {0.6 0.2} at lags [1 2] ARCH: {NaN} at lag [1] Leverage: {NaN} at lag [1] Offset: 0

The degrees of freedom property in the model is updated. Note that the `DoF`

field of `Distribution`

is not directly assignable. For example, `GJRMdl.Distribution.DoF = 8`

is not a valid assignment. However, you can get the individual fields:

DistributionDoF = GJRMdl.Distribution.DoF

DistributionDoF = 8

### Nonmodifiable Properties

Not all model properties are modifiable. You cannot change these properties in an existing model:

`P`

. This property updates automatically when the lag corresponding to the largest nonzero GARCH term changes.`Q`

. This property updates automatically when the lag corresponding to the largest nonzero ARCH or leverage term changes.

Not all name-value pair arguments you can use for model creation are properties of the created model. Specifically, you can specify the arguments `GARCHLags`

and `ARCHLags`

(and `LeverageLags`

for EGARCH and GJR models) during model creation. These are not, however, properties of `garch`

, `egarch`

, or `gjr`

model. This means you cannot retrieve or modify them in an existing model.

The ARCH, GARCH, and leverage lags update automatically if you add any elements to (or remove from) the coefficient cell arrays `GARCH`

, `ARCH`

, or `Leverage`

.

For example, specify an EGARCH(1,1) model:

Mdl = egarch(1,1)

Mdl = egarch with properties: Description: "EGARCH(1,1) Conditional Variance Model (Gaussian Distribution)" Distribution: Name = "Gaussian" P: 1 Q: 1 Constant: NaN GARCH: {NaN} at lag [1] ARCH: {NaN} at lag [1] Leverage: {NaN} at lag [1] Offset: 0

The model output shows nonzero GARCH, ARCH, and leverage coefficients at lag 1.

Add a new GARCH coefficient at lag 3:

Mdl.GARCH{3} = NaN

Mdl = egarch with properties: Description: "EGARCH(3,1) Conditional Variance Model (Gaussian Distribution)" Distribution: Name = "Gaussian" P: 3 Q: 1 Constant: NaN GARCH: {NaN NaN} at lags [1 3] ARCH: {NaN} at lag [1] Leverage: {NaN} at lag [1] Offset: 0

The nonzero GARCH coefficients at lags 1 and 3 now display in the model output. However, the cell array assigned to `GARCH`

returns three elements:

garchCoefficients = Mdl.GARCH

`garchCoefficients=`*1×3 cell array*
{[NaN]} {[0]} {[NaN]}

`GARCH`

has a zero coefficient at lag 2 to maintain consistency with traditional MATLAB® cell array indexing.

## See Also

### Objects

## Related Examples

- Specify GARCH Models
- Specify EGARCH Models
- Specify GJR Models
- Specify the Conditional Variance Model Innovation Distribution