Closed JieruiLin closed 2 years ago
For the last two lines in ParticleFilter::Update
,
// also need to consider gamma
particle.weight += log_p;
Since we're taking log-likelihoods, gamma becomes a constant coefficient of each term in the summation. My understanding was that since we're renormalizing the log-likelihoods, we don't need the precise absolute value of each log-likelihood – we only need to compare them relative to one another.
I think the last line should be an assignment rather than an addition since we're completely reweighting the particles.
Based on https://docs.google.com/presentation/d/1dSeiL4YbJ0yVgzvhlraW60Nufs04HkocrBpfwZl-RnQ/edit#slide=id.g99b286d0e8_0_971, we need to multiply the likelihood if we resample less often. So, it's addition in log space.
For the last two lines in
ParticleFilter::Update
,// also need to consider gamma particle.weight += log_p;
Since we're taking log-likelihoods, gamma becomes a constant coefficient of each term in the summation. My understanding was that since we're renormalizing the log-likelihoods, we don't need the precise absolute value of each log-likelihood – we only need to compare them relative to one another.
I think the last line should be an assignment rather than an addition since we're completely reweighting the particles.
Oh, I see. Thanks for clarifying!
This PR implements resample and enable updating several times before resample. Move normalization to resample function.