Statalist The Stata Listserver

[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: a problem on ml command

From   "Jian Zhang" <>
Subject   st: a problem on ml command
Date   Wed, 11 Oct 2006 23:12:58 -0700 (PDT)

Dear Statalisters,

I am using ml command to do maximum likelihood estimation with normal distribution of error 
terms.   But the the result returned with an error message.  I am new to ml command.   I am just 
playing with ml command and normal distribution to learn how to do mle using stata.  Any 
comments would be really appreciated.  Many thanks.

Best regards,

Jian Zhang

Here is the code I wrote:

 capture program drop try1
 program try1
         args lnf theta1 theta2
         quietly replace `lnf'=-1/2*ln(`theta2')-1/2*($ML_y1-`theta1')

ml model lf try1 (year=i firm) ()
ml maximize

But the result shows as follows :
initial:       log likelihood =     -<inf>  (could not be evaluated)
feasible:      log likelihood = -97165.343
rescale:       log likelihood = -60002.996
rescale eq:    log likelihood = -60002.996
could not calculate numerical derivatives
discontinuous region with missing values encountered

end of do-file

*   For searches and help try:

© Copyright 1996–2021 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index