If you multiply the values together, they look like this:
product = 1*p1*....*pn
If you take the natural log of both sides, it looks like this:
ln(product) = ln(1) + ln(p1) + .... + ln(pn)
But ln(1) = 0, since you initialize the sum of the logarithms. Set it to zero.
Remember what you are summarizing here: the journal of each probability is added to the journal of full probability. Once you complete the amount, you can receive the product as follows:
product = exp(ln(product)) = exp(ln(sum of ln(pn))
source
share