%% Regression Model with ARMA Errors
% This example shows how to plot the impulse response function of a regression model with ARMA errors.
% Specify the regression model with ARMA(4,10) errors:
% \begin{array}{c}{y_t} = 2 + {X_t}\left[ \begin{array}{l}5\\ - 1\end{array} \right] + {u_t}\\\left( {1 - 0.9L + 0.8{L^2} - 0.75{L^3} + 0.6{L^4}} \right){u_t} = \left( {1 + 0.5{L^2} - 0.4{L^4} - 0.3{L^6} + 0.2{L^8} - 0.1{L^{10}}} \right)\end{array}

Mdl = regARIMA('Intercept',2,'Beta',[5; -1],...
    'AR',{0.9, -0.8, 0.75, -0.6},...
    '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 autoregressive component is stable, and the moving average component is invertible. Therefore, Mdl defines a stationary error process.
% You do not need to specify the innovation variance.
%
% Plot the first 30 impulse responses.

impulse(Mdl,30)

% The impulse response decays to 0 since Mdl defines a stationary error process.
% Copyright 2015 The MathWorks, Inc.