Accelerating the pace of engineering and science

# Documentation Center

• Trial Software

## Modify Properties of Conditional Mean Model Objects

### Dot Notation

A model object created by arima has values assigned to all model object 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 object using dot notation. That is, type the object name, then the property name, separated by '.' (a period).

`model = arima(2,0,0)`
```model =

ARIMA(2,0,0) Model:
--------------------
Distribution: Name = 'Gaussian'
P: 2
D: 0
Q: 0
Constant: NaN
AR: {NaN NaN} at Lags [1 2]
SAR: {}
MA: {}
SMA: {}
Variance: NaN```

Modify the model to remove the constant term:

`model.Constant = 0`
```model =

ARIMA(2,0,0) Model:
--------------------
Distribution: Name = 'Gaussian'
P: 2
D: 0
Q: 0
Constant: 0
AR: {NaN NaN} at Lags [1 2]
SAR: {}
MA: {}
SMA: {}
Variance: NaN```

The updated constant term now appears in the model output.

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, AR, MA, SAR, and SMA are all cell vectors. This mean you must index them using cell array syntax.

`model = arima(2,0,0)`
```model =

ARIMA(2,0,0) Model:
--------------------
Distribution: Name = 'Gaussian'
P: 2
D: 0
Q: 0
Constant: NaN
AR: {NaN NaN} at Lags [1 2]
SAR: {}
MA: {}
SMA: {}
Variance: NaN```

To modify the property value of AR, assign AR a cell array. Here, assign known AR coefficient values:

`model.AR  = {0.8,-0.4}`
```model =

ARIMA(2,0,0) Model:
--------------------
Distribution: Name = 'Gaussian'
P: 2
D: 0
Q: 0
Constant: NaN
AR: {0.8 -0.4} at Lags [1 2]
SAR: {}
MA: {}
SMA: {}
Variance: NaN```

The updated model object now has AR coefficients 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'.

`model.Distribution`
```ans =

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:

`model.Distribution = 't'`
```model =

ARIMA(2,0,0) Model:
--------------------
Distribution: Name = 't', DoF = NaN
P: 2
D: 0
Q: 0
Constant: NaN
AR: {0.8 -0.4} at Lags [1 2]
SAR: {}
MA: {}
SMA: {}
Variance: NaN```

The updated model object has a Student's t distribution with NaN degrees of freedom. To specify a t distribution with eight degrees of freedom, say:

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

ARIMA(2,0,0) Model:
--------------------
Distribution: Name = 't', DoF = 8
P: 2
D: 0
Q: 0
Constant: NaN
AR: {0.8 -0.4} at Lags [1 2]
SAR: {}
MA: {}
SMA: {}
Variance: NaN```

The degrees of freedom in the model object are updated. Note that the DoF field of Distribution is not directly assignable. For example, model.Distribution.DoF = 8 is not a valid assignment. However, you can get the individual fields:

`model.Distribution.DoF`
```ans =

8```

You can modify model to include, for example, two coefficients β1 = 0.2 and β2 = 4 corresponding to two exogenous covariate time series. Since Beta has not been specified yet, you have not seen it in the output. To include it, enter:

`model.Beta=[0.2 4]`
```model =

ARIMAX(2,0,0) Model:
--------------------
Distribution: Name = 't', DoF = 8
P: 2
D: 0
Q: 0
Constant: NaN
AR: {0.8 -0.4} at Lags [1 2]
SAR: {}
MA: {}
SMA: {}
Beta: [0.2 4]
Variance: NaN```

### Nonmodifiable Properties

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

• P. This property updates automatically when any of p (degree of the nonseasonal AR operator), ps (degree of the seasonal AR operator), D (degree of nonseasonal differencing), or s (degree of seasonal differencing) changes.

• Q. This property updates automatically when either q (degree of the nonseasonal MA operator), or qs (degree of the seasonal MA operator) changes.

Not all name-value arguments you can use for model creation are properties of the created model object. Specifically, you can specify the arguments ARLags, MALags, SARLags, and SMALags during model creation. These are not, however, properties of arima model objects. This means you cannot retrieve or modify them in an existing model object.

The nonseasonal and seasonal AR and MA lags update automatically if you add any elements to (or remove from) the coefficient cell arrays AR, MA, SAR, or SMA.

For example, specify an AR(2) model:

`model = arima(2,0,0)`
```model =

ARIMA(2,0,0) Model:
--------------------
Distribution: Name = 'Gaussian'
P: 2
D: 0
Q: 0
Constant: NaN
AR: {NaN NaN} at Lags [1 2]
SAR: {}
MA: {}
SMA: {}
Variance: NaN```

The model output shows nonzero AR coefficients at lags 1 and 2.

Add a new AR term at lag 12:

`model.AR{12} = NaN`
```model =

ARIMA(12,0,0) Model:
--------------------
Distribution: Name = 'Gaussian'
P: 12
D: 0
Q: 0
Constant: NaN
AR: {NaN NaN NaN} at Lags [1 2 12]
SAR: {}
MA: {}
SMA: {}
Variance: NaN```

The three nonzero coefficients at lags 1, 2, and 12 now display in the model output. However, the cell array assigned to AR returns twelve elements:

`model.AR`
```ans =

[NaN]  [NaN]  [0]  [0]  [0]  [0]  [0]  [0]  [0]  [0]  [0]  [NaN]```

AR has zero coefficients at all the interim lags to maintain consistency with traditional MATLAB® cell array indexing.