www.gusucode.com > econ 案例源码程序 matlab代码 > econ/EstimateEGARCHModelParametersUsingPresampleDataExample.m

    %% Estimate EGARCH Model Parameters Using Presample Data  
% Fit an EGARCH(1,1) model to the daily close NASDAQ Composite Index returns.   

% Copyright 2015 The MathWorks, Inc.


%% 
% Load the NASDAQ data included with the toolbox. Convert the index to returns. 
load Data_EquityIdx
nasdaq = DataTable.NASDAQ;
y = price2ret(nasdaq);
T = length(y);

figure
plot(y)
xlim([0,T])
title('NASDAQ Returns')    

%%
% The returns exhibit volatility clustering.  

%% 
% Specify an EGARCH(1,1) model, and fit it to the series. One presample
% innovation is required to initialize this model. Use the first observation
% of |y| as the necessary presample innovation. 
Mdl = egarch(1,1);
[EstMdl,EstParamCov] = estimate(Mdl,y(2:end),'E0',y(1)) 

%%
% The output |EstMdl| is a new |egarch| model with estimated parameters.  

%% 
% Use the output variance-covariance matrix to calculate the estimate standard
% errors. 
se = sqrt(diag(EstParamCov)) 

%%
% These are the standard errors shown in the estimation output display.
% They correspond (in order) to the constant, GARCH coefficient, ARCH coefficient,
% and leverage coefficient.