# Difference between revisions of "Log odds"

m (added links to Arbital) |
AstraSequi (talk | contribs) (correct terminology) |
||

Line 1: | Line 1: | ||

− | {{arbitallink|https://arbital.com/p/bayes_log_odds/|Bayes' Rule: Log-odds form}}Log odds are an alternate way of expressing probabilities, which simplifies the process of updating them with new evidence. Unfortunately, it is difficult to convert between probability and log odds. The log odds is the log of the [[odds | + | {{arbitallink|https://arbital.com/p/bayes_log_odds/|Bayes' Rule: Log-odds form}}Log odds are an alternate way of expressing probabilities, which simplifies the process of updating them with new evidence. Unfortunately, it is difficult to convert between probability and log odds. The log odds is the log of the [[odds]]. Thus, the log odds of A are |

<math>logit\left(P(A)\right)</math> = log(P(A)/P(¬A)). | <math>logit\left(P(A)\right)</math> = log(P(A)/P(¬A)). | ||

Line 15: | Line 15: | ||

<math>logit\left(P(A|B)\right) = \log\left(\frac{P(B|A)}{P(B|\neg A)}\right) + logit\left(P(A)\right)</math> | <math>logit\left(P(A|B)\right) = \log\left(\frac{P(B|A)}{P(B|\neg A)}\right) + logit\left(P(A)\right)</math> | ||

− | Thus, in order to find the posterior log odds <math>logit\left(P(A|B)\right)</math>, one simply adds the prior log odds | + | Thus, in order to find the posterior log odds <math>logit\left(P(A|B)\right)</math>, one simply adds the prior log odds <math>logit\left(P(A)\right)</math> by the log of the likelihood ratio <math>\log\left(\frac{P(B|A)}{P(B|\neg A)}\right)</math>. |

The base of the logarithm determines what units the log odds are measured in, and doesn't matter so long as it's consistent. The natural log is usually used. | The base of the logarithm determines what units the log odds are measured in, and doesn't matter so long as it's consistent. The natural log is usually used. |

## Latest revision as of 18:30, 7 February 2020

Log odds are an alternate way of expressing probabilities, which simplifies the process of updating them with new evidence. Unfortunately, it is difficult to convert between probability and log odds. The log odds is the log of the odds. Thus, the log odds of A are

= log(P(A)/P(¬A)).

## Updating Log odds

Thus, in order to find the posterior log odds , one simply adds the prior log odds by the log of the likelihood ratio .

The base of the logarithm determines what units the log odds are measured in, and doesn't matter so long as it's consistent. The natural log is usually used.

## Examples

Suppose you have a box that has a 5% chance of containing a diamond. You also have a diamond detector that beeps half of the time if there is a diamond, and one fourth of the time if there is not. You wave the diamond detector over the box and it beeps.

The prior log odds of the box containing a diamond are ln(1/19) = -2.94. The log of the likelihood ratio of a beep is ln((1/2)/(1/4)) = ln(2) = 0.69. The posterior log odds are -2.94 + 0.69 = -2.23. This corresponds to an odds ratio of e^-2.23 = 0.108:1, and thus a probability of 0.108/1.108 = 0.097 = 9.7%. The correct answer is actually 9.5%. There was error due to rounding.