I am implementing a particle filter using MATLAB. I am implementing it first time. I have written the system model and measurement model. Given below:

noise1 = sd*randn(1, 1); v_init(i)= (normrnd(mean,sigma));
x_init(i)=(x_init(i-1)*noise1+v_init(i-1)); %p(x_k | x_(k-1))
noise2 = var(wgn(10,1,1)); n_init(i) = (normrnd(mean,sigma));
y_init(i) = noise2*x_init(i)+ n_init(i);    %p(y_k | x_k)

As far as I know, the prediction step involves the following equation:

$$ p\left ( x_{k} \right|D_{k-1} ) = \int p\left ( x_{k} \right | x_{k-1} )p\left (x_{k-1} \right|D_{k-1} ) dx_{k-1} $$

I cannot understand, how do I implement it. Kindly guide me what should be my next step?


The prediction step is to pass every particle's state [for e.g (x,y, theta)] through the system model that you have written as p(xk|xk-1). You have to update the state for each particle using this model. This comprises of the prediction step in the particle filter.

| improve this answer | |
  • $\begingroup$ I have taken particle's state as feature extracted from the moving image as dot. And write the prediction step in this form: x_predict(i) = x_init(i-1)+dot(i-1)+sin(x_init(i-1)-2); So, is it the correct way to write? $\endgroup$ – TariqS Apr 8 at 8:02
  • $\begingroup$ I did not understand the use of sin ? $\endgroup$ – vanshil shah Apr 9 at 9:18
  • $\begingroup$ purpose of sin is just to add some noise only $\endgroup$ – TariqS Apr 10 at 6:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.