%% Default Regression Model with ARMA Errors
% This example shows how to apply the shorthand regARIMA(p,D,q) syntax to specify the regression model with ARMA errors.
% Specify the default regression model with ARMA(3,2) errors:
% \begin{array}{l}{y_t} = c + {X_t}\beta  + {u_t}\\{u_t} = {a_1}{u_{t - 1}} + {a_2}{u_{t - 2}} + {a_3}{u_{t - 3}} + {\varepsilon _t} + {b_1}{\varepsilon _{t - 1}} + {b_2}{\varepsilon _{t - 2}}.\end{array}

Mdl = regARIMA(3,0,2)

% The software sets each parameter to NaN, and the innovation distribution to Gaussian. The AR coefficients are at lags 1 through 3, and the MA coefficients are at lags 1 and 2.
% Pass Mdl into estimate with data to estimate the parameters set to NaN. The regARIMA model sets Beta to [] and does not display it. If you pass a matrix of predictors (X_t) into estimate, then estimate estimates Beta. The estimate function infers the number of regression coefficients in Beta from the number of columns in X_t.
% Tasks such as simulation and forecasting using simulate and forecast do not accept models with at least one NaN for a parameter value. Use dot notation to modify parameter values.
% Copyright 2015 The MathWorks, Inc.