www.gusucode.com > econ 案例源码程序 matlab代码 > econ/RegressionModelwithMAErrorsExample.m
%% Regression Model with MA Errors % This example shows how to plot a regression model with MA errors. % Copyright 2015 The MathWorks, Inc. %% % Specify the regression model with MA(10) errors: % % $$\begin{array}{l}{y_t} = 2 + {X_t}\left[ \begin{array}{l}5\\ - 1\end{array} \right] + {u_t}\\{u_t} = {\varepsilon _t} + 0.5{\varepsilon _{t - 2}} - 0.4{\varepsilon _{t - 4}} - 0.3{\varepsilon _{t - 6}} + 0.2{\varepsilon _{t - 8}} - 0.1{\varepsilon _{t - 10}}.\end{array}$$ % Mdl = regARIMA('Intercept',2,'Beta',[5; -1],... 'MA',{0.5,-0.4,-0.3,0.2,-0.1},'MALags',[2 4 6 8 10]) %% % The dynamic multipliers are absolutely summable because the moving average % component is invertible. Therefore, |Mdl| is stationary. %% % You do not need to specify the innovation variance. %% % Plot the impulse response function for 10 responses. impulse(Mdl,10) %% % The impulse response of an MA error model is simply the MA coefficients % at their corresponding lags.