%% AR Model with Nonconsecutive Lags
% This example shows how to specify an AR(p) model with nonzero coefficients at nonconsecutive lags.
% Specify an AR(4) model with nonzero AR coefficients at lags 1 and 4 (and no constant term),
% {y_t} = 0.2 + 0.8{y_{t - 1}} - 0.1{y_{t - 4}} + {\varepsilon _t},
% where the innovation distribution is Gaussian with constant variance.

Mdl = arima('ARLags',[1,4],'Constant',0)

% The output shows the nonzero AR coefficients at lags 1 and 4, as specified. The property P is equal to 4, the number of presample observations needed to initialize the AR model. The unconstrained parameters are equal to NaN.
%
% Display the value of AR:

Mdl.AR

% The AR cell array returns four elements. The first and last elements (corresponding to lags 1 and 4) have value NaN, indicating these coefficients are nonzero and need to be estimated or otherwise specified by the user. arima sets the coefficients at interim lags equal to zero to maintain consistency with MATLAB® cell array indexing.
% Copyright 2015 The MathWorks, Inc.