%% Plot Generalized IRF of Univariate ARMA Model
% Plot the entire generalized IRF of the univariate ARMA(2,1) model
% (1 - 0.3L + 0.1L^2)y_t = (1 + 0.05L)\varepsilon_t.
% Because the model is in lag operator form, create the polynomials using the coefficients as you encounter them in the model.

AR0Lag = LagOp([1 -0.3 0.1])
MA0Lag = LagOp([1 0.05])

% AR0Lag and MA0Lag are LagOp lag operator polynomials representing the autoregressive and moving average lag operator polynomials, respectively.
%
% Plot the generalized IRF by passing in the lag operator polynomials.

armairf(AR0Lag,MA0Lag,'Method','generalized');

% The IRF is equivalent to the IRF in docid:econ_ug.buy19w9-2.
% Copyright 2015 The MathWorks, Inc.