# What is numerical overflow?

I came across an error of numerical overflow when running a maximum likelihood estimation on a log-linear specification.

What does numerical overflow mean?

It means that the algorithm generated a variable that is greater than the maximum allowed for that type of variable. That is due to the fact that computers use a finite number of bits to represent numbers, so it is not possible to represent ANY number, but only a limited subset of them.

The actual value depends on the type of variable and the architecture of the system.

Why that happens during a MLE I'm not sure, my best call would be that you should change the starting parameters.

You can probably avoid your overflow problems by working with the log of the likelihood function rather than the likelihood function itself. Both have the same maximum.

• It won't help if just the numerical algorithm is diverging for certain parameters.
– user88
Commented Aug 7, 2010 at 18:43

As stated by nico, numerical overflow is when computation finds a number that is too great for the limited number of bits allocated by software to store the number. For example, if your software uses 32 bits to store integers, then computing an integer that is greater than 2,147,483,648 (or smaller than -2,147,483,648) will cause overflow.

One common reason for numerical overflow is trying to divide by a very small (close to zero) number. If the absolute values of your numbers are not too large, Look at your data and try to figure out where you might be dividing by a very small number.