MathOverflow will be down for maintenance for approximately 3 hours, starting Monday evening (06/24/2013) at approximately 9:00 PM Eastern time (UTC-4).

## naive bayes gives negative probability [closed]

naive bayes theorem gives negative or small probabilities when the input is large. how to handle it? kindly help. I mean to say when i use naive bayes to calculate the probability of a certain word, and multiply all probabilities of such words the multiplication is so small that finally it gets rounded to either a 0 (zero) or nan. Exa i can give is: word proba for 8192 is 8132025 = 0 word proba for 8193 is 134514305 = 0 word proba for 8194 is -1081995183 = nan word proba for 8195 is 8192001 = nan

such thing comes when the no. of words in a document are more (in 1000's). i hope now its more clear. Thank u for any help.

-
Might I suggest math.stackexchange.com or stats.stackexchange.com for this sort of question. Also, I would recommend reading the FAQs before asking a question there. – David Roberts Jul 12 2011 at 11:55
Whereever the question belongs it should include an example of how negative probabilities occur. As is it us very vague. – Gil Kalai Jul 12 2011 at 12:02
Unfortunately, saying that a probability is more than 8 million (8132025) and that this large number equals 0 does not make anything clear. Both of those statements are absurd. – Andreas Blass Jul 13 2011 at 6:08
sorry for the mistake. i forgot to put a minus sign before some of the numbers. Anyways, thanx for everyone's help, i got the answer. When we try to multiply large numbers they actually get round up to 0 as its the limitation of the computer system, for that we can just calculate the log of all such large numbers and then do further calculation. Thank You. :) – monali Jul 26 2011 at 10:11