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

    %% Estimate GARCH Model Parameters Without Initial Values  
% Fit a GARCH(1,1) model to simulated data.   

% Copyright 2015 The MathWorks, Inc.


%% 
% Simulate 500 data points from the GARCH(1,1) model 
%
% $${y_t} = {\varepsilon _t},$$  
%
% where $\varepsilon_t = \sigma_tz_t$ and 
%
% $$\sigma _t^2 = 0.0001 + 0.5\sigma _{t - 1}^2 + 0.2\varepsilon _{t - 1}^2.$$
%
% Use the default Gaussian innovation distribution for $z_{t}$. 
Mdl = garch('Constant',0.0001,'GARCH',0.5,...
    'ARCH',0.2);
rng default; % For reproducibility
[v,y] = simulate(Mdl,500); 

%%
% The output |v| contains simulated conditional variances. |y| is a column
% vector of simulated responses (innovations).  

%% 
% Specify a GARCH(1,1) model with unknown coefficients, and fit it to the
% series |y|. 
ToEstMdl = garch(1,1);
EstMdl = estimate(ToEstMdl,y) 

%%
% The result is a new |garch| model called |EstMdl|. The parameter estimates
% in |EstMdl| resemble the parameter values that generated the simulated data.