%% Filter Multiple Disturbance Paths Through EGARCH Model
% Specify an EGARCH(1,1) model with Gaussian innovations.

Mdl = egarch('Constant',-0.1,'GARCH',0.8,'ARCH',0.3,...
    'Leverage',-0.05);

%
% Simulate 25 series of standard Gaussian observations for 100 periods.

rng(1); % For reproducibility
Z = randn(100,25);

% Z represents 25 paths of synchronized disturbances for 100 periods.
%
% Obtain 25 paths of conditional variances by filtering the disturbance paths through the EGARCH(1,1) model.

V = filter(Mdl,Z);

%
% Plot the paths of conditional variances.

figure;
plot(V);
title('Conditional Variance Paths');
xlabel('Periods');

% Copyright 2015 The MathWorks, Inc.