MATLAB Examples

Modify Properties Using Dot Notation

If you create a regression model with ARIMA errors using regARIMA, then the software assigns values to all of its properties. To change any of these property values, you do not need to reconstruct the entire model. You can modify property values of an existing model using dot notation. To access the property, type the model name, then the property name, separated by '|.|' (a period).

Specify the regression model with ARIMA(3,1,2) errors

$$\begin{array}{rcl}{y_t} &=& c + {u_t}\\\left( {1 - {\phi _1}L - {\phi
_2}{L^2} - {\phi _3}{L^3}} \right){\left( {1 - L} \right)^D}{u_t} &=&
\left( {1 + {\theta _1}L + {\theta _2}{L^2}} \right){\varepsilon
_t}.\end{array}$$

Mdl = regARIMA(3,1,2);

Use cell array notation to set the autoregressive and moving average parameters to values.

Mdl.AR = {0.2 0.1 0.05};
Mdl.MA = {0.1 -0.05}
Mdl = 

    ARIMA(3,1,2) Error Model:
    --------------------------
    Distribution: Name = 'Gaussian'
       Intercept: NaN
               P: 4
               D: 1
               Q: 2
              AR: {0.2 0.1 0.05} at Lags [1 2 3]
             SAR: {}
              MA: {0.1 -0.05} at Lags [1 2]
             SMA: {}
        Variance: NaN

Use dot notation to display the autoregressive coefficients of Mdl in the Command Window.

ARCoeff = Mdl.AR
ARCoeff =

  1x3 cell array

    {[0.2000]}    {[0.1000]}    {[0.0500]}

ARCoeff is a 1-by-3 cell array. Each, successive cell contains the next autoregressive lags.

You can also add more lag coefficients.

Mdl.MA = {0.1 -0.05 0.01}
Mdl = 

    ARIMA(3,1,3) Error Model:
    --------------------------
    Distribution: Name = 'Gaussian'
       Intercept: NaN
               P: 4
               D: 1
               Q: 3
              AR: {0.2 0.1 0.05} at Lags [1 2 3]
             SAR: {}
              MA: {0.1 -0.05 0.01} at Lags [1 2 3]
             SMA: {}
        Variance: NaN

By default, the specification sets the new coefficient to the next, consecutive lag. The addition of the new coefficient increases Q by 1.

You can specify a lag coefficient to a specific lag term by using cell indexing.

Mdl.AR{12} = 0.01
Mdl = 

    ARIMA(12,1,3) Error Model:
    --------------------------
    Distribution: Name = 'Gaussian'
       Intercept: NaN
               P: 13
               D: 1
               Q: 3
              AR: {0.2 0.1 0.05 0.01} at Lags [1 2 3 12]
             SAR: {}
              MA: {0.1 -0.05 0.01} at Lags [1 2 3]
             SMA: {}
        Variance: NaN

The autoregressive coefficient 0.01 is located at the 12th lag. Property P increases to 13 with the new specification.

Set the innovation distribution to the t distribution with NaN degrees of freedom.

Distribution = struct('Name','t','DoF',NaN);
Mdl.Distribution = Distribution
Mdl = 

    ARIMA(12,1,3) Error Model:
    --------------------------
    Distribution: Name = 't', DoF = NaN
       Intercept: NaN
               P: 13
               D: 1
               Q: 3
              AR: {0.2 0.1 0.05 0.01} at Lags [1 2 3 12]
             SAR: {}
              MA: {0.1 -0.05 0.01} at Lags [1 2 3]
             SMA: {}
        Variance: NaN

If DoF is NaN, then estimate estimates the degrees of freedom. For other tasks, such as simulating or forecasting a model, you must specify a value for DoF.

To specify a regression coefficient, assign a vector to the property Beta.

Mdl.Beta = [1; 3; -5]
Mdl = 

    Regression with ARIMA(12,1,3) Error Model:
    ------------------------------------------
    Distribution: Name = 't', DoF = NaN
       Intercept: NaN
            Beta: [1 3 -5]
               P: 13
               D: 1
               Q: 3
              AR: {0.2 0.1 0.05 0.01} at Lags [1 2 3 12]
             SAR: {}
              MA: {0.1 -0.05 0.01} at Lags [1 2 3]
             SMA: {}
        Variance: NaN

If you pass Mdl into estimate with the response data and three predictor series, then the software fixes the non-|NaN| parameters at their values, and estimate Intercept, Variance, and DoF. For example, if you want to simulate data from this model, then you must specify Variance and DoF.