In maximum likelihood estimation, one typically needs to compute the log (natural log) of probability values. When a probability, say $p(x)$, becomes so close to zero, $log(p(x))$ returns -Inf. What is the usual trick to avoid these cases?
Remember to vote up questions/answers you find interesting or helpful (requires 15 reputation points)
|
2
1
|
|
|
5
|
Work with the logs of probability directly, rather than trying to compute the probability and then compute the log. You can do arithmetic with the logs, as well; multiplication becomes addition, of course. Addition is somewhat more complicated, but it's not too hard to work out how to do it without taking the exponential back. In response to JM's question, it's easy to come up with practical problems where the probability of something happening is indeed so low that it underflows a float or double. |
|||||||||||||||||
|


-Infunless your starting values for your iteration are really bad... – J. M. Oct 21 2010 at 5:29