1

It's probably easy, but I'm stuck on this small thing.

In R, I've being doing operations with likelihood values. Because they are very small I use their log representation to do their multiplication and division. However I need to add some now... how can I do that?

Example:

a and b are very small numbers

I have only A and B which are

A = ln a
B = ln b

How to compute

a + b

EDIT: I'm sorry for the unclear question. The answer is already present in Dealing with very small numbers in R

There is a formula for the sum of numbers represented by their log

Diogo Santos
  • 804
  • 2
  • 13
  • 26

1 Answers1

0

I hope I got you right, but what I understood is that you want to compute

a+b

given that

A = ln a
B = ln b

holds.

To get a and b out of A and B you just need to apply the inverse function of the logarithm for an exponential basis, which is simply the expotential function:

a=exp(A)
b=exp(B)
Jogi
  • 304
  • 4
  • 15