Hello,
I'm trying to simulate GARCH model, but my code doesn't work properly. It stops at some point and the values are the same.
clear;
clc;
parameters=zeros(1,3);
parameters(1,1)=0.2;
parameters(1,2)=0.7;
parameters(1,3)=0.3*(1-(parameters(1,1)+parameters(1,2)));
results=zeros(1000,2);
results(1,1)=1
results(1,2)=1
for i=2:1000
randn('seed',11);
results(i,2) = parameters(1,3)+parameters(1,1)*(results(i-1,1))^2+parameters(1,2)*results(i-1,2);
results(i,1)=randn*sqrt(results(i,2));
end
1 Comment
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/718750-simulate-garch-1-1#comment_1278003
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/718750-simulate-garch-1-1#comment_1278003
Sign in to comment.