My goal is to find closed form equations for posterior marginals $P(x_n|y_0, ... , y_n)$ in a general HMM.
I was told that we can calculate it exactly via BP (belief propagation, thought not sure how BP comes in the picture...) in an iterative manner in two steps:
Prediction step: Transitioning to a new state:
$$p(x_{n+1} | y_0, ..., y_n) = \int_{x_n}p(x_{n+1}|x_{n}) p(x_{n}|y_0, ... , y_n) dx_n $$
Update: Folding in a new observation:
$$p(x_{n+1} | y_0, ..., y_{n+1}) = \frac{1}{Z}p(y_{n+1} | x_{n+1}) p(x_{n+1}|y_0, ... , y_n)$$
I was also told that Z is the partition function which is an implicit integral.
However, I did not understand the mathematical correctness of the update equation. Does someone know why that is mathematically correct?
I guess what confuses me is that its not clear to me how to use probabilities calculated in the prediction step can be used to calculate the next hidden state in an HMM and include the new observation.
Also, how is this using belief propagation? Is the integral somewhere suppose to be a message as in BP?
This is what I have tried:
$$p(x_{n+1} | y_0, ..., y_{n+1}) = \frac{p(x_{n+1}, y_0, ... y_n, y_{n+1}) }{p(y_0, ..., y_n, y_{n+1} )} = \frac{p(y_{n+1}| x_{n+1}, y_0, ... y_n,)p(x_{n+1}, y_0, ..., y_n)}{p(y_0, ..., y_n, y_{n+1} )}$$
By the conditional independencies implies by the graphical model of an HMM we have $p(y_{n+1}| x_{n+1}, y_0, ... y_n,) = p(y_{n+1}| x_{n+1})$
$$ \frac{p(y_{n+1}| x_{n+1})p(x_{n+1}, y_0, ..., y_n)}{p(y_0, ..., y_n, y_{n+1} )}$$
Doing hayes rule again we get:
$$ \frac{p(y_{n+1}| x_{n+1})p(x_{n+1} | y_0, ..., y_n) p(y_0, ... , y_n)}{p(y_0, ..., y_n, y_{n+1} )}$$
Which if my math is correct means that the partition function is:
$$ \frac{1}{Z} = \frac{ p(y_0, ... , y_n) }{p(y_0, ... , y_n, y_{n+1}} )$$
Which doesn't involve any implicit integral as far as I can tell... am I doing something wrong? Does this seem correct?
I do know that the partition function is suppose to normalize a normalized probability distribution, however, I don't see why it matters in this context... is that what it refers to as an implicit integral?