Statalist


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

Re: st: Stata's ml sticks


From   Sergiy Radyakin <[email protected]>
To   [email protected]
Subject   Re: st: Stata's ml sticks
Date   Wed, 28 Jan 2009 13:22:13 -0500

Dear Austin,

thank you for your suggestion. I have also received the same
suggestion from Roger Harbord earlier today and this seems to be
working much better. I am a bit concerned that I may not know the
right-bound for the interval, so I would rather prefer a method with
Xn=F(Xn-1)  where I could specify an initial guess, and then move
freely. So far -ridder- gives me the message

      range does not bound solution
      r(409);

in cases when my expectation for right bound is too low, so I will
have to capture that and expand the interval until it covers the root.
Otherwise I am very happy with how it works (about 12 calls to F() vs
173,000+ iterations of ml and no convergence).

Sadly, Mata optimize is not available in Stata 9 or is it undocumented there?

One problem that I've noticed with -ridder- is that it does not
understand global names longer than 8 symbols, e.g. if my F() returns
the result in global test_res, ridder F X returns macro test_res =
-0.01 from 0 to 0.2 works fine, but if F() returns the result in
global test_res2, then ridder F X returns macro test_res = -0.01 from
0 to 0.2 comes to an error because it evaluates both F(LEFT)=0 and
F(RIGHT)=0. Perhaps it's a limitation of the older Stata due to
version?

Thank you Roger and Austin.

Best regards, Sergiy Radyakin


On Wed, Jan 28, 2009 at 12:15 PM, Austin Nichols
<[email protected]> wrote:
> That should be
> Mata -optimize()- of course--see
> http://www.stata.com/help.cgi?mf_optimize
>
> On Wed, Jan 28, 2009 at 11:56 AM, Austin Nichols
> <[email protected]> wrote:
>> Sergiy--
>> Why are you using -ml- for this?  Assuming you have no access to Stata
>> 10 for this problem, where Mata -maximize- is the obvious solution,
>> you can use -ridder- (findit ridder) described at
>> http://www.stata.com/products/stb/journals/stb17.html, with subsequent
>> updates, or you can do it manually in various ways...  If you must use
>> -ml-, you probably can get better performance by reparametrizing the
>> function somehow, e.g. maximize -(ln(F/A)^2 or somesuch.
> *
> *   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/
>
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index