mat=readmat('data.txt');
rmat=diff(log(mat(180:1000,633)));
rmat=rmat(find(rmat));
rmat=flipud(rmat);
[Coeff,Errors,LLF,Innovations,Sigmas,Summary] = garchfit(rmat);

s= garchfit(rmat);
h=250;
future=garchpred(s, rmat, h);
x2=[length(rmat)+1:length(rmat)+h];

x1=[1:length(rmat)];

plot(Sigmas);
plot(x1,Sigmas,'-',x1,rmat,'-',x2,future,'-');