Skip to content

Best practices for handling very small numbers?

7 messages · Nordlund, Dan (DSHS/RDA), Duncan Murdoch, Ben Bolker +1 more

#
Maybe you should work with the log-likelihood?


Hope this is helpful,

Dan

Daniel J. Nordlund
Washington State Department of Social and Health Services
Planning, Performance, and Accountability
Research and Data Analysis Division
Olympia, WA 98504-5204
#
On 11-10-18 4:30 AM, Seref Arikan wrote:
I think you are calculating the log likelihood incorrectly.  Don't 
calculate the likelihood and take the log; work out the formula for the 
log of the likelihood, and calculate that.  (If the likelihood contains 
a sum of terms, as in a mixture model, this takes some thinking, but it 
is still worthwhile.)

With most models, it is just about impossible to cause the log 
likelihood to underflow if it is calculated carefully.

Duncan Murdoch
#
Duncan Murdoch <murdoch.duncan <at> gmail.com> writes:
I haven't followed this carefully, but there is a special problem
in Bayesian situations where at some point you may have to *integrate*
the likelihoods, which implies dealing with them on the likelihood
(not log-likelihood) scale.  There are various ways of dealing with
this, but one is to factor a constant (which will be a very small value)
out of the elements in the integrand.

  Ben Bolker
1 day later
#
On 19/10/2011 12:02 PM, Seref Arikan wrote:
I think you would do better to estimate the posterior directly.  It may 
be slow, but that just means that you need more computing power.

Duncan Murdoch