Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: ML estimation using stata


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: ML estimation using stata
Date   Thu, 15 Apr 2010 18:38:02 +0100

A general comment is that a good way to test a program like this is to
check that it produces sensible estimates for data that you know to be
well described by the model. Otherwise how you do know that you are not
trying to fit the wrong model to the data (or the model or the wrong
data)? 

Also, is that really the log-likelihood? I expect to see more plus signs
in log-likelihood definitions. 

Nick 
n.j.cox@durham.ac.uk 

Sridhar Telidevara

ML estimation is not able to find feasible values for the following
program.

X is a dummy variable in the data. I defined  X to be a global
variable and gave the name x1 to X.

global x1 X


program define myprog
      version 11

      args todo b lnf
      tempvar theta1 theta2
 	
      mleval `theta1'=`b', eq(1)
      mleval `theta2'=`b', eq(2) scalar
	

	quietly {
	
mlsum `lnf' =
$x1*(ln((exp(-`theta1')*$ML_y1)^(exp(-`theta2'))*exp(-`theta2')/((1+(exp
(-`theta1')*$ML_y1)^(exp(-`theta2')))^2*$ML_y1))...

:
:
:
}

ml check resolves x1 to X. However, it is unable to find feasible
values.  I guess it's the problem with x1. Otherwise it's a simple
program.  can somebody please help?


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index