# Numeric problem when evaluating log of a pdf

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?

-
If you're maximizing, I can't see how you'd hit a -Inf unless your starting values for your iteration are really bad... –  J. M. Oct 21 '10 at 5:29

What if $p(x)$ is a mixture model, e.g. a Gaussian mixture: $p(x;\theta) = \sum_{i=1}^N \pi_i f(x;\mu_i, \Sigma_i)$? You cannot express $log(p(x))$ analytically, and yet you might have some of the $p(\cdot)$ values very close to zero. –  eakbas Oct 31 '10 at 17:40