MATLAB Examples

MA Model with Nonconsecutive Lags

This example shows how to specify an MA(q) model with nonzero coefficients at nonconsecutive lags.

Specify an MA(4) model with nonzero MA coefficients at lags 1 and 4 (an no constant term),

$${y_t} = {\varepsilon _t} + {\theta _1}{\varepsilon _{t - 1}} + {\theta _{12}}{\varepsilon _{t - 12}},$$

where the innovation distribution is Gaussian with constant variance.

model = arima('MALags',[1,4],'Constant',0)
model = 

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

The output shows the nonzero AR coefficients at lags 1 and 4, as specified. The property Q is equal to 4, the number of presample innovations needed to initialize the MA model. The unconstrained parameters are equal to NaN.

Display the value of MA:

model.MA
ans =

  1x4 cell array

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

The MA cell array returns four elements. The first and last elements (corresponding to lags 1 and 4) have value NaN, indicating these coefficients are nonzero and need to be estimated or otherwise specified by the user. arima sets the coefficients at interim lags equal to zero to maintain consistency with MATLAB® cell array indexing.