Page 1 of 1
MLE with normal mixture distribution
Posted: Thu Jun 16, 2011 7:48 pm
by kusdhianto
Dear All,
I tried to replicate estimation using ML method with normal mixture distribution as in Greene textbook (Econometric Analysis, 6th ed., p. 559).
I have created Logl object, and set up as follows:
Code: Select all
@logl logl
res = gpa-c(1)-c(2)*grade-c(3)*psi-c(4)*tuce
var1 = c(5)
var2 = c(6)
lambda = c(7)
logl=log(lambda*(@dnorm(res/@sqrt(var1))-log(var1)/2)+(1-lambda)*(@dnorm(res/@sqrt(var2))-log(var1)/2))
when I ran the estimation, a message pops up: Error Message, Missing values in @LOGL series at current coefficients observation 1.
please tell me what's wrong and the solution to this problem. I also attached my work file. thank you.
Re: MLE with normal mixture distribution
Posted: Fri Jun 17, 2011 1:07 am
by trubador
This is one of the most frequent problems that EViews users encounter. The error message, on the other hand, is very explanatory. It basically says that it cannot generate the likelihood function for the first observation, and therefore cannot begin estimation. This may be caused by numerous reasons and you can find many examples on this issue if you search the forum. That said, I am pretty sure (without even looking at your workfile) that the starting values of coefficients cause the trouble in your case. Initializing the coefficient vector with proper values should solve your problem.
Re: MLE with normal mixture distribution
Posted: Fri Jun 17, 2011 3:06 am
by kusdhianto
thank you for your reply,
can you suggest me, how to determine the appropriate initial value of the coefficients? should I enter the initial value in the coefficients series?
Re: MLE with normal mixture distribution
Posted: Fri Jun 17, 2011 6:59 am
by trubador
Yes, you can enter initial values of parameters to the coefficient vector in the workfile (i.e. c). You can also use the param command.
Re: MLE with normal mixture distribution
Posted: Fri Jun 17, 2011 8:49 am
by kusdhianto
thanks a lot, yes it works, now the pop up message is disappear.
but i realize that the likelihood function I quoted above is wrong, then i get another problem: how to state loglikehood function for normal mixture distribution in eviews?
my case is that:
Prob(class=1)=lambda
Prob(class=2)=1-lambda
both classes are normally distributed with var1 and var2 for variance of class 1 and class 2 respectively.
I tried this:
logl2=log(lambda*@dnorm(res1/@sqrt(var1))+(1-lambda)*@dnorm(res2/@sqrt(var2)))-(lambda*log(var1)/2)-((1-lambda)*log(var2)/2)
but it seems wrong as the results are not what I expected. please suggest me the correct one.
Re: MLE with normal mixture distribution
Posted: Sun Jun 19, 2011 9:55 pm
by kusdhianto
any help please..