%% MA Error Model with Nonconsecutive Lags
% This example shows how to specify a regression model with MA errors, where the nonzero MA terms are at nonconsecutive lags.
% Specify the regression model with MA(12) errors:
% \begin{array}{l}{y_t} = c + {X_t}\beta  + {u_t}\\{u_t} = {\varepsilon _t} + {b_1}{\varepsilon _{t - 1}} + {b_{12}}{\varepsilon _{t - 12}}.\end{array}

Mdl = regARIMA('MALags',[1, 12])

% The MA coefficients are at lags 1 and 12.
%
% Verify that the MA coefficients at lags 2 through 11 are 0.

Mdl.MA'

% After applying the transpose, the software displays a 12-by-1 cell array. Each consecutive cell contains the corresponding MA coefficient value.
% Pass Mdl and data into estimate. The software estimates all parameters that have the value NaN. Then estimate holds b_2 = b_3 =...= b_{11} = 0 during estimation.
% Copyright 2015 The MathWorks, Inc.