Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSMC with Optional Resampling #24

Open
THargreaves opened this issue Nov 19, 2024 · 6 comments
Open

CSMC with Optional Resampling #24

THargreaves opened this issue Nov 19, 2024 · 6 comments

Comments

@THargreaves
Copy link
Collaborator

The definitions of CSMC that I can find seem to assume that resampling takes place at every step and so don't worry about setting the weight for the reference trajectory.

We need to think carefully about what this weight should be.

@charlesknipp
Copy link
Collaborator

I personally don't see any problems with resampling at every step. Although, Chopin's implementation of CSMC sets ESSmin = 0.5 by default (see here). I'm not too experienced with Particle Gibbs in practice, so I don't have a tough stance on this either way.

@THargreaves
Copy link
Collaborator Author

THargreaves commented Nov 19, 2024

Ah okay, so he must show how to handle the weights in the case of no resampling somewhere in the code base then. Struggling to find where though

Oh wait it's literally in the code snippet you shared. He just sets the value and doesn't update the weight. That feels a bit strange to me

@charlesknipp
Copy link
Collaborator

The CSMC class he defines only overloads generate_particles and resample_move, so the reweight_particles function is still performed at every iteration of the filter. For reference, his generic SMC code is linked here

@THargreaves
Copy link
Collaborator Author

Generalising this issue to talk about all issues related to the implementation details of CSMC.

Our previous approach was saving the filtered states but this doesn't work for Rao-Blackwellisation if we're going to "insert" the reference trajectory at the end of the predict step. In this case the Gaussian state is essentially corrected twice leading to the wrong estimates.

I've done a temporary fix by saving the proposed states but I think the better idea would be to save the filtered states and update the ref after the update step.

@THargreaves
Copy link
Collaborator Author

The CSMC class he defines only overloads generate_particles and resample_move, so the reweight_particles function is still performed at every iteration of the filter. For reference, his generic SMC code is linked here

What I mean is that during generate_particles he just overwrites the first value of X but doesn't touch the log weights. I'm assuming this must be correct but it's surprising to me in the optional resampling case.

@THargreaves
Copy link
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants