I am trying to estimate GARCH models with the use of Hansen's (1994) skew-t distribution. I am using matlab's ARMAX-GARCH-K toolbox, where the log-likelihood is calculated as:
lamda = parameters(end-1);
nu = parameters(end);
c = gamma((nu+1)/2)/(sqrt(pi*(nu-2))*gamma(nu/2));
a = 4*lamda*c*((nu-2)/(nu-1));
b = 1 + 3*lamda^2 - a^2;
indicator1 = ((data(t)-mu(t))./sqrt(h(t))<-a./b);
indicator2 = ((data(t)-mu(t))./sqrt(h(t))>=-a./b);
likelihoods1 = log(b) + log(c) - ((nu+1)./2).*log(1+1./(nu-2).*((b.*indicator1.*((data(t)-mu(t))./sqrt(h(t)))+a)./(1-lamda)).^2);
likelihoods2 = log(b) + log(c) - ((nu+1)./2).*log(1+1./(nu-2).*((b.*indicator2.*((data(t)-mu(t))./sqrt(h(t)))+a)./(1+lamda)).^2);
likelihoods = - 0.5*log(h(t)) + indicator1.*likelihoods1 + indicator2.*likelihoods2;
where data(t)
stands for returns, mu(t)
is the mean from the GARCH model, h(t)
is the variance from the GARCH model and parameters
are the parameters of the GARCH model. The whole function for calculating the log-likelihood can be found here (viewing without opening matlab): https://www.mathworks.com/matlabcentral/fileexchange/32882-armax-garch-k-toolbox--estimation--forecasting--simulation-and-value-at-risk-applications-/content/garchlik.m
And the distribution is defined as in the following paper on page 6: http://www.ssc.wisc.edu/~bhansen/papers/ier_94.pdf
I have two questions:
1. The square by the b parameter seems to be missing, so after defining b i should take values equal to sqrt(b). Is that right?
2.Where does the term - 0.5*log(h(t))
in likelihoods
come from? As it does not appear in the pdf function of the skew-t distribution.
I would be grateful for any help :)