Mata -optimize()- is also designed as a maximizer (or minimizer)
rather than a root-finder. -ridder- is designed to be a root-finder so
seems a better option to me. -ridder- was written in Stata 3.1 so
although it still works fine in Stata 10 (and intermediate versions i
assume) the syntax looks more than a bit old fashioned.
I've just noticed that a more recent alternative in Mata is mm_root(),
part of Ben Jann's -moremata- package on SSC. mm_root() implement's
Brent's method, which Numerical Recipes describes as "the method of
choice for general one-dimensional root-finding where a function's
values only (and not its derivative or functional form) are
available", which sounds like Sergiy's situation to me. -moremata-
requires only Stata 9 so this could be an option for Sergiy if he's
able to reprogram his function in Mata.
William H. Press, Saul A. Teukolsky, William T. Vetterling, and Brian
P. Flannery. Numerical Recipes in C: The Art of Scientific Computing
(Section 9.3 "Van Wijngaarden--Dekker--Brent Method"). 2nd edition.
Cambridge University Press, 1992.
<http://www.nrbook.com/a/bookcpdf.php>
--
Roger Harbord
http://www.epi.bris.ac.uk/staff/rharbord.htm
On Wed, Jan 28, 2009 at 5: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/