Trouble understanding a Bayesian update over multiple hypotheses

29 Views Asked by At

I have found the following formulation for Bayes' Theorem for multiple hypotheses:
$P(h \mid e) = \Large {P(e \mid h) P(h) \over \sum_i P(e \mid h_i) P(h_i)}$
Suppose I have three hypotheses and three possible types of events:
$P(e \mid h_i) = \left[ \begin{matrix} 0.8 & 0.1 & 0.1 \\ 0.1 & 0.8 & 0.1 \\ 0.1 & 0.1 & 0.8 \\ \end{matrix} \right]$, and some prior belief $P(h)=(0.6,0.2,0.2)$
I want to find $P(h_0 \mid e)$.
It seems to me that $P(e \mid h_0) P(h_0) = (0.8,0.1,0.1)\cdot(0.6) = (0.48,0.06,0.06)$
and that
$\sum_i P(e \mid h_i) P(h_i) = \left[ \begin{matrix} 0.8 & 0.1 & 0.1 \\ 0.1 & 0.8 & 0.1 \\ 0.1 & 0.1 & 0.8 \\ \end{matrix} \right] \left[ \begin{matrix} 0.6 \\ 0.2 \\ 0.2 \\ \end{matrix} \right] = (0.52,0.24,0.24)$
and now
$(0.48,0.06,0.06) / (0.52,0.24,0.24) = (0.923,0.25,0.25)$
Just to check my understanding, I repeat for the other two hypotheses and
$P(h_0 \mid e) = (0.923,0.250,0.250)$
$P(h_1 \mid e) = (0.038,0.667,0.083)$
$P(h_2 \mid e) = (0.038,0.083,0.667)$
The probabilities in each event category add up to 1, so am I right in thinking that if I next see an event of the first type, then my new belief across hypotheses should be $(0.923, 0.038, 0.038)$ ?
How would this equation change if instead of discrete events, I had some distribution over events, such as the output of a classifier? How would I then update my belief in each class?
My intuition is that I would take these conditional beliefs $P(h \mid e)$ and create a linear combination of these. Suppose I receive probabilistic evidence $P(e) = (0.75,0.15,0.10)$ and marginalize over events:
$ P(h) = P(h \mid e) P(e) = \left[ \begin{matrix} 0.923 & 0.250 & 0.250 \\ 0.038 & 0.667 & 0.083 \\ 0.038 & 0.083 & 0.667 \\ \end{matrix} \right] \left[ \begin{matrix} 0.75 \\ 0.15 \\ 0.10 \\ \end{matrix} \right] = (0.755,0.132,0.101)$ as the new belief.
Is this correct?