function F=normlike(theta,e2) omega=theta(1); alpha=theta(2); beta=theta(3); T=max(size(e2)); s2=zeros(size(e2)); s2(1)=e2(1); for i=2:T s2(i)=omega+alpha*e2(i-1)+beta*s2(i-1); end F=0.5*(T-1)*log(2*pi)+0.5*sum(e2(2:T)./s2(2:T))+0.5*sum(s2(2:T));