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: moptimze: what's the difference of these practices


From   Sun Yutao <yutao.sun.statalist@outlook.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: moptimze: what's the difference of these practices
Date   Wed, 14 Nov 2012 19:05:02 +0100

Hi,

I¡¯m working with -moptimize()- and I just want know what¡¯s the difference 
between directly using the parameter feed by the -moptimize()- and 
using -moptimize_util_xb()-

I have a callback function say: feval(M,p,v) and when I'm using the p directly 
to compute the log-likelihood it always says "could not calculate numerical 
derivatives -- flat or discontinuous region encountered", but according to the 
help file: " The second argument, b (p in my function), is the entire 
coefficient vector". Here is an example of how I would compute the 
xb: -xb=XB*p[1::4]':+p[5]-   (4 x*b + a cons)

But when I switch to -xb=moptimize_util_xb(M,b,1)-, everything is ok again...

Does anyone know the difference of these two?

Best regards,
Sun Yutao




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


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