www.gusucode.com > econ 案例源码程序 matlab代码 > econ/ARMAModelExample.m
%% ARMA Model % This example shows how to plot the impulse response function for an autoregressive % moving average (ARMA) model. The ARMA(_p_, _q_) model is given by % % $${y_t} = \mu + \frac{{\theta (L)}}{{\phi (L)}}{\varepsilon _t},$$ % % where $\theta(L)$ is a _q_-degree MA operator polynomial, $(1 + {\theta % _1}L + \ldots + {\theta _q}{L^q})$, and $\phi(L)$ is a _p_-degree AR % operator polynomial, $(1 - {\phi _1}L - \ldots - {\phi _p}{L^p})$. % % An ARMA process is stationary provided that the AR operator polynomial is % stable, meaning all its roots lie outside the unit circle. In this case, % the infinite-degree inverse polynomial, $\psi (L) = {{\theta (L)} % \mathord{\left/ {\vphantom {{\theta (L)} {\phi (L)}}} \right. % \kern-\nulldelimiterspace} {\phi (L)}}$ , has absolutely summable % coefficients, and the impulse response function decays to zero. % Copyright 2015 The MathWorks, Inc. %% Step 1. Specify an ARMA model. % Specify an ARMA(2,1) model with coefficients $\phi_1$ = 0.6, $\phi_2 = -0.3$, and $\theta_1 = 0.4$. modelARMA = arima('AR',{0.6,-0.3},'MA',0.4); %% Step 2. Plot the impulse response function. % Plot the impulse response function for 10 periods. impulse(modelARMA,10)