Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: RE: ML estimation using stata


From   "Nick Cox" <[email protected]>
To   <[email protected]>
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 
[email protected] 

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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index