MATLAB Examples

Default AR Model

This example shows how to use the shorthand arima(p,D,q) syntax to specify the default AR($p$) model,

$${y_t} = c + {\phi _1}{y_{t - 1}} +  \ldots  + {\phi _p}{y_{t - p}} + {\varepsilon _t}.$$

By default, all parameters in the created model object have unknown values, and the innovation distribution is Gaussian with constant variance.

Specify the default 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 output shows that the created model object, model, has NaN values for all model parameters: the constant term, the AR coefficients, and the variance. You can modify the created model object using dot notation, or input it (along with data) to estimate.