MATLAB Examples

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), $p_s$ (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 $q_s$ (degree of the seasonal MA operator) 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 ARLags, MALags, SARLags, and SMALags during model creation. These are not, however, properties of arima models. This means you cannot retrieve or modify them in an existing model.

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:

Mdl = arima(2,0,0)
Mdl = 

    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:

Mdl.AR{12} = NaN
Mdl = 

    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:

Mdl.AR
ans =

  1x12 cell array

  Columns 1 through 8

    {[NaN]}    {[NaN]}    {[0]}    {[0]}    {[0]}    {[0]}    {[0]}    {[0]}

  Columns 9 through 12

    {[0]}    {[0]}    {[0]}    {[NaN]}

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