Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Loop with ML estimations


From   "Maarten Buis" <[email protected]>
To   <[email protected]>
Subject   st: RE: Loop with ML estimations
Date   Mon, 21 May 2007 13:18:07 +0200

--- [email protected] wrote:
> I have run into problems with an ML estimation. I have both problems
> with "ml search" as well as with non-convergence: "ml search" simply
> cannot not find suitable initial conditions (even after specifying a
> range) and when I indicate initial conditions myself, I either get the
> error message "could not calculate numerical derivatives missing values
> encountered r(430);" or some of the parameter estimates are missing.

This happens to me all the time when I am programming a new -ml-
procedure, but it is invariably caused by me forgetting a minus sign
or multiplying things that should be added, or something like that. 
I would first try to find the error in your likelihood program before
trying anything else. (It may require just putting it aside for a day)

> What I now want to do is to have loops with "ml model ...,
> init(parameter1:_cons = `a' parameter2:_cons = `b' ...) maximize" where
> I systematically go through a grid of various initial conditions
> specified as `a',  `b' and so on.
> 
> The problem, however, is that as soon as ml produces an error message
> (as the one above) for a given set of initial conditions, the evaluation
> of the loops is interrupted. How can I make sure, that the evaluation of
> the loops is continued even when ml produces an error message? I would
> be most grateful for any hint.

Doing a grid search like that can be useful for other reasons, but not for
the problem you sketched above. If you want to do a grid search that is 
not stopped when a single call has failed to converge you can precede the
call to ml with -capture-, see: -help capture-. 

Hope this helps,
Maarten

-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology 
Vrije Universiteit Amsterdam 
Boelelaan 1081 
1081 HV Amsterdam 
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434 

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------


 

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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