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

    %% Store an Impulse Response Function  

% Copyright 2015 The MathWorks, Inc.


%% 
% Specify the following regression model with ARMA(2,1) errors: 
%
% $$\begin{array}{*{20}{l}}
% \begin{array}{c}
% {y_t} = {X_t}\left[ {\begin{array}{*{20}{c}}
% {0.1}\\
% { - 0.2}
% \end{array}} \right] + {u_t}\\
% {u_t} = 0.5{u_{t - 1}} - 0.8{u_{t - 2}} + {\varepsilon _t} - 0.5{\varepsilon _{t - 1}},
% \end{array}
% \end{array}$$
%
% where $\varepsilon_{t}$ is Gaussian with variance 0.1. 
Mdl = regARIMA('Intercept',0, 'AR', {0.5 -0.8}, ...
    'MA',-0.5,'Beta',[0.1 -0.2], 'Variance',0.1);  

%% 
% Store the impulse response function for 15 periods. 
Y = impulse(Mdl,15) 

%%
% The length of the output impulse response series is |numObs|.