www.gusucode.com > econ 案例源码程序 matlab代码 > econ/MAModelwithNonconsecutiveLagsExample.m

    %% MA Model with Nonconsecutive Lags  
% This example shows how to specify an MA(_q_) model with nonzero coefficients
% at nonconsecutive lags.   

% Copyright 2015 The MathWorks, Inc.


%% 
% Specify an MA(4) model with nonzero MA coefficients at lags 1 and 4 (an
% no constant term), 
%
% $${y_t} = {\varepsilon _t} + {\theta _1}{\varepsilon _{t - 1}} + {\theta _{12}}{\varepsilon _{t - 12}},$$
%
% where the innovation distribution is Gaussian with constant variance.
model = arima('MALags',[1,4],'Constant',0) 

%%
% The output shows the nonzero AR coefficients at lags 1 and 4, as specified.
% The property |Q| is equal to |4|, the number of presample innovations
% needed to initialize the MA model. The unconstrained parameters are equal
% to |NaN|.  

%% 
% Display the value of |MA|: 
model.MA 

%%
% The |MA| 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(R) cell array indexing.