Hello,
thank you all for your responses.
@Sven: I already encountered trying to log() a negative number in a different model, but
when that happens, the error message is "Warning: log domain blahblah". Besides,
this error of mine was happenning before any estimation attempts, so I knew this was not
the problem.
@Allin, @Riccardo: Thank you for directing me to gig, I never knew gretl had addons:) I
modified the code to use lngamma() instead of log(gammafun()) and lo and behold,
everything runs. So is it somehow possible, that log(gammafun(x)) cannot take x of type
series while lngamma(x) can eat series? Because that is what it looks like to me. I
didn't change the starting values or anything else, just switched log(gammafun(..)) to
lngamma(). The resulting code is thus
<hansl>
scalar c = 0.1
scalar a1 = 0.1
# GARCH - h[t] = cg + ga*h[t-1] + arc*e^2[t-1]
scalar cg = 0.1
scalar ga = 0.1
scalar arc = 0.1
scalar dof = 4
mle ll = lngamma((dof + 1)/2) - lngamma(dof/2) - 0.5*log(dof-2) - log(h) - 0.5*(dof +
1)*log(1 + (dof - 2)^(-1)*h^(-2)*e^2)
series e = 0
series e = allRng - c - a1*allRng(-1) #AR1 process
series h = var(allRng)
series h = cg + ga*h(-1) + arc*(e(-1))^2 # GARCH(1,1)
params c a1 cg ga arc dof
end mle
</hansl>
If for any purposes somebody needs my data, I will be glad to upload them and share the
link. Thanks again.
All the best,
Daniel.