Statalist


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

st: noisily summarize `lnf in ML Model'


From   "Glenn Goldsmith" <[email protected]>
To   <[email protected]>
Subject   st: noisily summarize `lnf in ML Model'
Date   Sun, 12 Apr 2009 20:11:26 +0100

Hi,

I'm afraid Quang's help request may not make a lot of sense to anybody other
than Quang or me. Quang previously emailed me off-list, asking for help with
an error he was receiving from -ml-

  "-<inf> could not be evaluated"

I provided him with some general advice, including the fact that the error
was likely due to missing `lnf' values, and suggested ways that he might try
to track down the error.

Now, if I understand correctly, he is receiving the error message: 

  "numerical derivatives are approximate nearby values are missing"

As the -summarize- results suggest, this is essentially the same problem,
but with the missing `lnf' observations now only occurring for some
parameter values. As such, I would simply reiterate my previous advice:

If you can't figure out why [you might be getting missing `lnf' values] just
by looking at the code, then you want to start looking at the values you use
to calculate `lnf'.

(a) -noisily summarize- all the variables/tempvars you use to calculate
`lnf' just before the line where you calculate it. If any of them are
missing, then this will be a source of problems. 

(b) -noisily display- any other scalars or macros you use in the
calculation. Again, if any of them are missing, then it will also cause
problems. (Though usually this would manifest itself in an error message.)

If you discover something missing, then go back to where that is calculated
and see if you can spot the problem there. If not, repeat (a) and (b) again
there.

If neither (a) nor (b) are the problem, then there's some sort of issue with
the code you use to do the calculation. If you can't figure out what it is,
try posting the line with the problem to the list again, and someone might
be able to help you.

The only thing I would add now is that, when trying to figure out what's
going on, you probably want to be on the lookout for functions that return
missing values only for some values of the arguments. E.g. if some parameter
values result in your program trying to take the log of a non-positive
number you'll get a missing value.

I'd also emphasize that you're more likely to get useful responses the more
specific you are about the nature of your problem. So, e.g. posting the
relevant lines of your code would help. 


HTH,

Glenn.

Quang Nguyen <[email protected]> wrote:

Dear All:

To debug an ML program, I use noisily summarize `lnf'. Here is part of
the report:


    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
    __000011 |         0

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
    __000011 |      4968    .6044496    .3089994   .0080576   .9919424

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
    __000011 |      3496    .5906751    .4917796          0          1


Since there is some zero observation in `lf', the "ml model" doesn't
work. Can anyone suggest how I can proceed next given the above
information?

Many thanks!

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