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

Mdl = regARIMA(0,0,2)

% The software sets each parameter to NaN, and the innovation distribution to Gaussian. The MA coefficients are at lags 1 and 2.
% Pass Mdl into estimate with data to estimate the parameters set to NaN. Though Beta is not in the display, 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.