Statalist


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

Re: st: mata optimize


From   Stas Kolenikov <[email protected]>
To   [email protected]
Subject   Re: st: mata optimize
Date   Mon, 5 Oct 2009 16:36:54 -0500

Oh, and one more thing: when I try -optimize_evaluate()- without any
previous optimization attempts, it breaks down as follows:

             opt__eval():  3010  attempt to dereference NULL pointer
    _optimize_evaluate():     -  function returned error


On Mon, Oct 5, 2009 at 3:15 PM, Stas Kolenikov <[email protected]> wrote:
> 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/
>



-- 
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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index