Statalist


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

st: mata optimize


From   Stas Kolenikov <skolenik@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: mata optimize
Date   Mon, 5 Oct 2009 15:15:44 -0500

I try to implement some sort of random search over the parameter space
to supply good starting values in my Mata -optimize- problem, and I
was hoping to use -optimize_evaluate()- for that purpose. My
understanding, from the manual, was that it takes the initial values
(supplied by -optimize_init_params()-), computes the function and
posts the results into (the Mata structure visible as)
-optimize_result*()-. As it does not perform any optimization, the
init_params and result_params should be the same. However, they are
not:

: optimize_init_params(Sth, uniform(1,2) )

: optimize_init_params(Sth )
                 1             2
    +-----------------------------+
  1 |  .0087578271   .3072360181  |
    +-----------------------------+

:    _optimize_evaluate(Sth)
b12 =  .0581941, b13 =   .690081, theta1 = -.0485678, log-likelihood =
 -7.07196
  0

: optimize_result_params( Sth )
                 1             2
    +-----------------------------+
  1 |  .0581940888   .6900808689  |
    +-----------------------------+

: optimize_init_params(Sth, uniform(1,2) )

: optimize_init_params(Sth )
                 1             2
    +-----------------------------+
  1 |  .4972361468   .8971257419  |
    +-----------------------------+

:    _optimize_evaluate(Sth)
b12 =  .0581941, b13 =   .690081, theta1 = -.0485678, log-likelihood =
 -7.07196
  0

: optimize_result_params( Sth )
                 1             2
    +-----------------------------+
  1 |  .0581940888   .6900808689  |
    +-----------------------------+

:

The vector (0.058, 0.690) is what was there before (after a painful
non-convergent minimization attempt with lots of problematic numeric
derivatives), and it looks like -optimize_evaluate()- just ignored the
starting values I gave.

Am I missing something, or is it a bug? Stata 11 is fully up to date.


-- 
Stas Kolenikov, also found at http://stas.kolenikov.name
Small print: I use this email account for mailing lists only.
*
*   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   |   What's new   |   Site index