# Particle filter reducing the covariance matrix of joint normal distribution too much [closed]

I am working on developing a particle filter to improve the results of an Unscented Kalman filter (UKF) to satellite attitude determination. The UKF outputs a 12-dimensional joint normal distribution (the proposal distribution), from which I randomly sample N points (particles) (currently N=100). Then the particle filter uses the observation data to assign weights to the particles (more likely to produce the observations => more weight to the particle), and then I calculate the new vector of weighted means and the weighted unbiased sample covariance matrix using the formula given here: https://en.wikipedia.org/wiki/Sample_mean_and_covariance#Weighted_samples

Then the vector of means and the covariance matrix are fed into the UKF (it treats them as if they came from a normal distribution) and it produces a new joint normal distribution output, and the cycle is repeated for each timestep.

The particle filter seems to be working very well and it's improving the results of the Kalman filter (the results are similar, but more smooth). However, thanks to the weights assigned during the particle filter step, the variances and covariances become very small, until they're approximated as 0 by the code and the whole thing crashes after a certain number of timesteps. (The variance/covariance becoming too small is also an inherent problem, as the filter can never be 100% exact.)

In a sense, this is to be expected, since the weights assigned by the particle filter often give more importance to the points closer to the mean (since ideally the mean is close to the observation data), which then contribute less to the variance/covariance. Is there a way to artificially keep the covariance matrix from becoming too small? Or is there something wrong with using the particle filter this way? Thoughts?

## closed as unclear what you're asking by Michael Chernick, gung♦, Taylor, kjetil b halvorsen, DougalJul 16 '17 at 21:34

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• Can you add more details about how exactly the particle filter is used – Juho Kokkala Jul 6 '17 at 10:12

## 1 Answer

I am not fully aware of your system (and therefore do not understand why you would need random sampling here at all). However, as I understand it, one thing that seems not correct is assigning different weights to your randomly drawn samples. This is not necessary as the weighting is already implicitly considered by the fact that they were drawn from the normal distribution and therefore automatically more samples are placed around the mean. Your approach might not harm the computation of the mean but, if understood correctly, it most certainly harms the computation of the covariance.

• Sorry, the question was worded a bit ambiguously - what I meant is this: the weights assigned by the particle filter often give more importance to the points closer to the mean, since ideally the mean is close to the observation data. So the weights aren't assigned based on the distribution the samples were drawn from (that would indeed be rather pointless), that distribution is just the proposal distribution. The weights are assigned based on observation data, and tailoring the proposal distribution to the observation data is precisely what we need random sampling and the particle filter for. – Mari Aug 1 '16 at 17:09