Statalist


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

st: Any way to obtain just gradient/scores from mata -optimize()- (without calculating hessian)?


From   "Glenn Goldsmith" <[email protected]>
To   <[email protected]>
Subject   st: Any way to obtain just gradient/scores from mata -optimize()- (without calculating hessian)?
Date   Thu, 19 Feb 2009 18:54:59 -0000

Dear list,

I have an estimator I am trying to code using mata -optimize()-. During the
estimation, there are points at which I want to obtain the score matrix and
gradient vector for a specified parameter value. However, because
calculating the Hessian is computationally very intensive, I really want to
avoid computing it when it is not necessary to do so. 

I had originally assumed that I could do this simply by calling
-optimize_evaluate()- followed by the appropriate -optimize_result_*()-
calls. However, it seems that -optimize_evaluate()- *does* compute the
Hessian automatically (i.e. before any subsequent call to
-optimize_result_Hessian()-). 

One thing which seems to help (in terms of reducing the number of calls to
the evaluator) is to set -optimize_init_technique()- to one of the
quasi-Newton methods, such as bhhh. (This was contrary to the impression I
got from -help mf_optimize- which states that the setting of
-optimize_init_technique()- does not matter, but I guess makes sense when
you think about it.) However, this last approach still seems a bit of a
hack, I have no idea whether there is, or should be a more efficient way of
getting to just the quantities I want. 

Any help or suggestions on this front would be very greatly appreciated!

Best wishes,

Glenn.

*
*   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