Bayes Theorem

Formal

Definition of conditional probability:

P(AB)P(AB)P(B)(1)P(A|B) \triangleq \frac{P(A \cap B)}{P(B)} \tag{1}

The Derivation:

  1. By the definition, we can write the joint probability P(AB)P(A \cap B) in two ways (swapping AA and BB):
P(AB)=P(AB)P(B)P(BA)=P(BA)P(A)\begin{align} P(A \cap B) = P (A|B)P(B) \\ P(B \cap A) = P(B|A)P(A) \end{align}
  1. Since P(AB)=P(BA)P(A\cap B) = P(B\cap A):
P(AB)P(B)=P(BA)P(A)P(A|B)P(B)=P(B|A)P(A)
  1. Divide by P(B)P(B):
P(AB)=P(BA)P(A)P(B).(2)P(A|B)=\frac{P(B|A)P(A)}{P(B)}. \tag{2}

ML Context

AθA \rightarrow \theta (Model Parameters / Hypothesis) BDB \rightarrow D (Observed Data / Evidence)

P(θD)Posterior=P(Dθ)LikelihoodP(θ)PriorP(D)Evidence(3)\underbrace{P(\theta | D)}_{\text{Posterior}} = \frac{\underbrace{P(D | \theta)}_{\text{Likelihood}} \cdot \underbrace{P(\theta)}_{\text{Prior}}}{\underbrace{P(D)}_{\text{Evidence}}} \tag{3}
Connections
  • #conditional-probability
  • #bayes-theorem