# Calculating the observation density

For a state space model $$x_{k+1} = f(x_{k}, u_k, w_k)$$ $$y_k = H x_k + v_k$$ where the measurement function is assumed linear and Gaussian and the state transition is not necessarily linear nor Gaussian.

In the context of an SIS particle filter with the transitional prior as the proposal density $$q(x_k|x_{k-1}^i,z_k)=p(x_k|x_{k-1}^i)$$ this leads to the weight update equation $$w_k^i \propto w_{k-1}^i p(z_k|x_{k}^i)$$

I am unsure on how to evaluate $$p(z_k|x_{k}^i)$$. Assuming that the particles $$x_k^i$$ are normally distributed I would think $$p(z_k|x_k^i) = \frac{e^{-0.5(H x_k^i-z_k)^T\Sigma^{-1}(H x_k^i-z_k)}}{\sqrt{(2\pi)^n\text{det}(\Sigma)}}$$ Where $$\Sigma$$ is the measurement noise covariance and $$n$$ is the dimension of the state space, but I am not entirely sure.

In the context of an SIS particle filter with the transitional prior as the proposal density $$q(x_k|x^i_{k-1},z_k)= p(x_k | x_{k-1},z_k)$$

Two things: one, SIS stands for "sequential importance sampling." This is the name used to describe importance sampling without resampling. They add the word sequential because usually the target distribution is for some long sequence of random variables. You might be confusing this acronym with SISR, which stands for, "sequential importance sampling with resampling." In my opinion, the inclusion of R is important. I think it lead to some confusion in the comment section on your last post.

Second, when you write $$q(x_k|x^i_{k-1},z_k)= p(x_k | x_{k-1},z_k)$$, that is the optimal proposal, and that's not the same as the "transitional prior" proposal. As I mentioned in the other post, those are two separate algorithms. If you were using the latter, you would instead write something like $$q(x_k|x^i_{k-1},z_k)= p(x_k | x^i_{k-1})$$. Because you are not conditioning on observed data from the most recent time point, your proposed samples would tend to not hug the target distribution, and so the variance of the weights, or your effective sample size, would be poorer.

If you are using the "transitional prior," aka the "bootstrap filter" or the "condensation algorithm," then it is correct your weight updates would be $$w_k^i \propto w_{k-1}^i p(z_k|x_{k}^i)$$.

Finally, your last expression is correct (if you ignore the missing $$z$$ on the left hand side). I am referring to $$p(z_k|x_k^i) = \frac{e^{-0.5(H x_k^i-z_k)^T\Sigma^{-1}(H x_k^i-z_k)}}{\sqrt{(2\pi)^n\text{det}(\Sigma)}},$$ although it is more conventional to write it (equivalently) as $$p(z_k|x_k^i) = \frac{e^{-0.5(z_k - H x_k^i)^T\Sigma^{-1}(z_k - H x_k^i)}}{\sqrt{(2\pi)^n\text{det}(\Sigma)}}.$$

• whoops I can see I made a typo when copying over, It was actually my intention to write the proposal density equal to $p(x_k|x_{k-1}^i)$. But thank you. Commented Jan 4, 2020 at 20:04
• Also is it common for literature on this topic to be a little contradictory with naming. I feel like I've seen a couple different definitions of what SIS stands for and can't tell if it's a mispelling or a new "definition. I like SISR though, it is a lot more precise. Commented Jan 4, 2020 at 20:05
• Yeah, the naming can be confusing. By the way, I see you use c++. I've implemented a lot of this stuff here: github.com/tbrown122387/pf Commented Jan 4, 2020 at 20:52