# Understanding Sequential Importance Sampling and Particle Filtering

I am struggling with SIS for particle filtering in the following aspect:

In particle filtering (as per this book), the objective is to estimate the full posterior $p( x_{0:k} \mid y_{1:k} )$ rather than the marginal posterior $p( x_k \mid y_{1:k} )$. It seems to me that this is the case because in the recursion for the full posterior, no integral equation is involved (whereas the recursion for the marginal posterior requires solving the Chapman-Kolmogorov Equation), is that correct?

[This excerpt is from page 121 of the linked book]

Given this recursion and the knowledge of $p( y_k \mid x_k )$ (measurement model) and $p( x_k \mid x_{k-1} )$ (evolution model), what is the objective to use SIS here?

To me it looks like the new full posterior can be computed whenever $p( x_{0:k-1} \mid y_{1:k-1} )$ is known from the previous recursion.

Adding to my confusion is the following part of the introduction of SIS in the above mentioned book: There, it is said that in SIS we would like to compute (conditional) expectations of the posterior in the form of $$\mathbb{E}( g(x_k) \mid y_{1:k} )$$ But where in the recursion above (or in the filtering in general) is that exactly needed?

First, let clarify that characterizing $p(x_{0,T}|y_{1,T})$ (or $p(x_{t}|y_{1,T})$, $t \le T$) is called smoothing. "By opposition", filtering consists in characterizing $p(x_{t}|y_{1,t})$ ($t \le T$). These are two different (but related) quantities.

In some case (classically, gaussian with linear dynamic and observation function), $p(x_{t}|y_{1,t})$ has a close-form solution and indeed the recursion allow to propagate from $t$ to $t+1$. However, in more general cases, you never have tractable form for $p(x_{t}|y_{1,t})$. In this case Monte-Carlo based approach are of interest to offer a sample-based characterization of it: instead of having a tractable form for $p(x_{t}|y_{1,t})$ you deal with a tractable way to "sample" from it. Moreover, in the case of filtering and smoothing, you need a dedicated Monte Carlo approach that accounts for the sequential recursion. The SIS is such a Monte Carlo method: it provides a procedure -relying on the sequential form of the filtering distribution- to update the samples from $t$ to $t+1$ in an efficient way.

Finally generally, we are not looking for the full density but for an estimator of the form $E(g(x_{1,k})|y_{1,k})$ (that includes the posterior mean with $g$ is identity) which is a quantity that can be estimated from the Monte Carlo "samples".

Note: I used quotation marks around "sample" because SIS samples are not necessary samples in the classical sense.

## Questions

1. Is the particle filter estimating the full posterior $$p(x_{0:k}\,|y_{1:k})$$ or the marginals $$p(x_k\,|\,y_{1:k})$$?

2. Given the recursion $$p(x_{0:k}\,|y_{1:k})\propto p(y_k\,|\,x_k)p(x_k\,|\,x_{k-1})p(x_{0:k-1}\,|\,y_{1:k-1})$$ why do I need a particle filter at all? If I know $$p(x_{0:k-1}\,|\,y_{1:k-1})$$, can't I just apply the recursion directly and compute the posterior?

3. What does $$\mathbb{E}(g(x_k)∣y_{1:k})$$ have to do with it?

1. A particle filter is estimating the full posterior $$p(x_{0:k}\,|y_{1:k})$$. Asymptotically (in the number of particles), particle filter approximations "converge" to the full posterior. In practice however, simple particle filters do a better job at approximating the marginal posterior $$p(x_k\,|\,y_{1:k})$$ than they do at approximating the full posterior $$p(x_{0:k}\,|y_{1:k})$$, so that's what people use them for most often. And given this, people often discuss particle filters as if they only estimate $$p(x_k\,|\,y_{1:k})$$, but this is not the case. Doucet and Johansen have good discussion about this.
2. The recursion is certainly valid if you know $$p(x_{0:k-1}\,|\,y_{1:k-1})$$, but in practice you don't. A particle filter is iteratively approximating the sequence of posteriors $$p(x_0)$$, $$p(x_{0:1}\,|\,y_1)$$, ..., $$p(x_{0:k}\,|y_{1:k})$$, ..., and it uses the recursion to update from one to the next. So you don't know $$p(x_{0:k-1}\,|\,y_{1:k-1})$$, but if you have an approximation to it generated by a particle filter, you can use the recursion to update that approximation and get an approximation to $$p(x_{0:k}\,|\,y_{1:k})$$.
3. $$\mathbb{E}(g(x_k)∣y_{1:k})$$ has nothing to do with using a particle filter to approximate the posterior $$p(x_{0:k}\,|\,y_{1:k})$$, but once you have approximated the posterior, you might want to use your approximation to estimate a quantity like $$\mathbb{E}(g(x_k)∣y_{1:k})$$. If $$g$$ is just the identity function, you have $$\mathbb{E}(x_k∣y_{1:k})$$. So you could use your posterior approximation to estimate the posterior mean of the states for example.