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 :)


1- It seems to me there is a problem in the original code the variable b should be defined as b= sqrt(1 + 3*lamda^2 - a^2)

2- The likelihood is defined just after equation 8. in the paper. You have to take into account the $ \frac{1}{\sigma}$ term (in $ \frac{1}{\sigma} \times g(..) $ , ie to scale the densitie) . So the - 0.5*log(h(t)) refers to this part.

Explanation :


$= \frac{1}{\sigma} \times g(..) $

Log-Likelihood :

$ = log(\frac{1}{\sigma})+log( g(..)) $

$ = log(1)-log(\sigma) +log( g(..)) $

$ = 0 - log( \sqrt{ \sigma^{2}}) +log( g(..))$

$ = - log\left( (\sigma^{2})^{0.5}\right) +log( g(..))$

$= -0.5 \times log(\sigma^{2}) +log( g(..))$

The first terms of the precedent equation refer to the - 0.5*log(h(t)) part.

  • $\begingroup$ Thanks for you clarification @Malick, it was really helpful. Just to be sure, this scaling of the densite is true for other distributions as well, right? $\endgroup$ – Masher Dec 17 '15 at 18:06
  • 1
    $\begingroup$ yes if you normalize the y variable (equation 7) $\endgroup$ – Malick Dec 17 '15 at 19:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.