# Bayesian Theorem Update Inference

According to Bayes theorem $P(A|B) = \frac{P(B|A)*P(A)}{P(B)}$

I've found somewhere that: $P(x_t|z_{1:t}) = \frac{P(z_t|x_t)*P(x_t|z_{1:t-1})}{P(z_t|z_{1:t-1})}$ but I don't really understand it, is it expressed according to the bayes theorem ?

This is from page 13 of http://www.igi.tugraz.at/pfeiffer/documents/particlefilters.pdf

EDIT after @ConjugatePrior's answer :

According to Bayes theorem $P(x_t|z_{1:t}) = \frac{P(z_{1:t}|x_t)*P(x_t)}{P(z_{1:t})}$ and this is equal to $\frac{P(z_t,z_{1:t-1}|x_t)*P(x_t)}{P(z_t,z_{1:t-1})}$, but since $z_t$ and $z_{t-1}$ are conditionally independent given $x_t$ (according to the above figure), then $P(z_t,z_{1:t-1}|x_t) = P(z_t|x_t)*P(z_{1:t-1}|x_t)$, so we get $\frac{P(z_t|x_t)*P(z_{1:t-1}|x_t)*P(x_t)}{P(z_t,z_{1:t-1})}$ and again according to Bayes theorem we have $P(z_{1:t-1}|x_t) = P(x_t|z_{1:t-1})*P(z_{1:t-1}) / P(x_t)$, so we get $\frac{P(z_t|x_t)*P(x_t|z_{1:t-1})*P(z_{1:t-1})}{P(z_t,z_{1:t-1})} = \frac{P(z_t|x_t)*P(x_t|z_{1:t-1})*P(z_{1:t-1})}{P(z_t|z_{1:t-1})*P(z_{1:t-1})} = \frac{P(z_t|x_t)*P(x_t|z_{1:t-1})}{P(z_t|z_{1:t-1})}$ • The picture misleading: In it the past of X is independent of the present X given the present Z. Your equations (and the slides) are the exact opposite (basically Z and X are switched). – conjugateprior Apr 24 '12 at 14:42
• @ConjugatePrior Oh well I see. So generally, is the $x$ notation which is used for data-points and $z$ for the hidden variables (like in the picture), or is it the opposite (like in my equations) ? – shn Apr 24 '12 at 15:19
• It depends - that's why you can find examples of both. I'd guess $x$ as the state is more common. – conjugateprior Apr 24 '12 at 15:24
• Also, is it always true that: $P(X|Y) = \int P(X|Z)*P(Z|Y) dz$ ? – shn Apr 24 '12 at 15:38
• No it isn't. (That's what additional the conditional independence assumption is giving you.) It might be a good idea to have a look at some Bayesian network work to get a better feel for this sort of thing. I think Russell and Norvig's book has decent introductory coverage. The ML folk around the forum should have some good suggestions too. – conjugateprior Apr 24 '12 at 16:03

## 1 Answer

It is, but you're being confused by the extra unmentioned assumption: conditional independence of the past observations and the current observation given the current state. Your slides do not bother to draw the state space model diagram for the state space time series models they're interested in. This is unfortunate because you can read off this relationship directly.

To make it look like your first version of Bayes theorem, rewrite $P(z_t | x_t)$ to condition also on $z_{1\ldots t-1}$ as everything else does. That should look more familiar. Now notice that the conditional independence assertion above means that once you condition on $x_t$, $z_t$ no longer actually depends on its past, the part you just added in. So you can take it back out.

• I've edited my first post, is that what you wanted to say ? – shn Apr 24 '12 at 14:12
• Err, not quite. When you condition on something you put it on the right hand side of the bar. – conjugateprior Apr 24 '12 at 14:18
• Oh, I think I see what you're doing. – conjugateprior Apr 24 '12 at 14:21