%% 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)} / {\phi (L)}} , has absolutely summable coefficients, and the impulse response function decays to zero.
%% Specify ARMA Model
% Specify an ARMA(2,1) model with coefficients \phi_1 = 0.6, \phi_2 = -0.3, and \theta_1 = 0.4.

Mdl = arima('AR',{0.6,-0.3},'MA',0.4);

%
%% Plot Impulse Response Function
% Plot the impulse response function for 10 periods.

impulse(Mdl,10)

% Copyright 2015 The MathWorks, Inc.