# Thread: Particle Filter

1. ## Particle Filter

I am developing a Particle Filter, and would like to understand some of the maths/ideas behind them more fully. For example, i understand that the particle filter is supposed to approximate the posterior pdf at each step. But i do not understand if it does this via particle weights, or via the distribution of the particles themselves...? Many of the equations seem to show it using the weights, i.e. the pdf is approximated by the sum of the weights each shifted to the correct state value by the dirac delta. Yet at other times the weights of all the particles are normalized, so i can only assume at this point that it is the actual distribution of the particles themselves that is being used...?

Anyone shed any light?

2. ## Re: Particle Filter

Originally Posted by pvn
I am developing a Particle Filter, and would like to understand some of the maths/ideas behind them more fully. For example, i understand that the particle filter is supposed to approximate the posterior pdf at each step. But i do not understand if it does this via particle weights, or via the distribution of the particles themselves...? Many of the equations seem to show it using the weights, i.e. the pdf is approximated by the sum of the weights each shifted to the correct state value by the dirac delta. Yet at other times the weights of all the particles are normalized, so i can only assume at this point that it is the actual distribution of the particles themselves that is being used...?

Anyone shed any light?
Both or either, it depends on the implementation.

CB

3. ## Re: Particle Filter

ok - get that now (i've done some experiments): many thanks.

Could you explain importance sampling to me? i understand that if its hard to draw samples from p(x) for example, then instead you sample from q(x), and then weight by p(x)/q(x). What i don't get is how i calculate p(x)?

All i have in my particle filter is the approx to the posterior at any given step represented by my particles, p(x). in my case these are the x,y co-ordinates of an object i'm tracking. i'd like to re-sample in order to get more particles in the high probability region, because a bunch of them have died (i.e. gone to 0 probability or thereabouts). My standard re-sampling algorithm just creates new duplicate particles with the same state space values as the old ones, drawn in accordance to the pdf.

What i want it to do is give me new particles with new state space values (e.g. to get an estimate of an accelerometer bias for example). So i could do importance sampling and generate some completely new samples from my importance distribution q(x-new). But then how do i work out p(x-new) for that sample? All i have is the existing samples. Do i use the nearby samples to calculate a value for p(x)?

i've just got a feeling that i'm missing something fundamental here...

4. ## Re: Particle Filter

Originally Posted by pvn
ok - get that now (i've done some experiments): many thanks.

Could you explain importance sampling to me? i understand that if its hard to draw samples from p(x) for example, then instead you sample from q(x), and then weight by p(x)/q(x). What i don't get is how i calculate p(x)?

All i have in my particle filter is the approx to the posterior at any given step represented by my particles, p(x). in my case these are the x,y co-ordinates of an object i'm tracking. i'd like to re-sample in order to get more particles in the high probability region, because a bunch of them have died (i.e. gone to 0 probability or thereabouts). My standard re-sampling algorithm just creates new duplicate particles with the same state space values as the old ones, drawn in accordance to the pdf.

What i want it to do is give me new particles with new state space values (e.g. to get an estimate of an accelerometer bias for example). So i could do importance sampling and generate some completely new samples from my importance distribution q(x-new). But then how do i work out p(x-new) for that sample? All i have is the existing samples. Do i use the nearby samples to calculate a value for p(x)?

i've just got a feeling that i'm missing something fundamental here...
You can use the existing particles and Kernel Density Estimation to give an analytic representation of the distribution that can then be sampled from (essentially each particle is replaced by a normal weighted by the particle probability).

CB

5. ## Re: Particle Filter

Thanks Captain Black - that's really starting to make sense now. Am i right to think then that this would be a regularised particle filter (RPF)?

Actually, can i take a step, back. What i'm trying to do is estimate the position of a body (for which i have orientation data) from the body frame accelerometer signals. i have some (absolute) observation data and statistical knowledge of the system to help. So far i can use a simple looking bootstrap filter to incorporate my accelerometer data and observations etc. and overcome the issues around the doubly integrated accelerometer noise term to get a good result inside the tolerance i need. So my next step is to incorporate a state variable for the bias of the accelerometers. If i just include this in my existing filter, the particles lose diversity and i get no result (since the bias is considered constant at this point and there is no step-wise noise term).

Could you suggest an appropriate method for including this parametric estimation into the filter i have already got?

Seems like i just need to "spread out" the bias estimates for the surviving particles, but if i do this i don't know what values to use for my other state variables for the particle i.e. the velocity and position, because these depend on the bias values in a complex way (due to the constantly changing orientation). I could always re-run that particle again from the start...but that seems a bit drastic.

Any thoughts?