# Likelihood calculation in Particle Filtering

I have a doubt with likelihood calculation in particle filtering.

In my understanding the particle filter consists of the following steps

1. Generate particles from initial point

2. Propagate through system model ($X_p(k) = A*X_f(k-1) + Q$) (I am generating Gaussian noise and adding to state equation based on $Q$ for each particle)

3. Weight update using likelihood calculation For likelihood calculation I need measurement from sensor (with Gaussian noise) and predicted measurement

For the predicted measurements, I have to use the measurement equation $$y = H*x + R$$ For each particle I have to calculate corresponding $y$ value.

Should I generate Gaussian noise based of R for every particle while calculating predicted measurement y?

In the Kalman filter we use $y = H*x$ ( since we are calculating mean), what should I do in particle filter...?

Just compute the likelihood of data given the particles. For 1-d

normpdf(y(k),x_particles,standard_dev_of_noise)


For multi-dimensional case

mvnpdf(y(k),H*x_particles,R)


These will be your weights. Then get the resampling indices according to your favorite resampling algorithm and resample your particles.