-
-
Notifications
You must be signed in to change notification settings - Fork 988
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
Resampler for weighed samples #3352
Conversation
…ctive.MHResampler) that converts weighed samples into equally weighed samples.
…amples resampler.
Hi @BenZickel, thanks for your patience. I'm not sure I understand how Also, do you understand the relationship betwen your
My thinking then was that it would be nice to bridge the two worlds: weighted versus uniform samples. I figured a simple way to convert weighted -> unweighted samples would be to add a method |
Thx @fritzo for the review! The intended use of Regarding your second point, Lastly, you mentioned _systematic_resample which does resampling from a fixed set of samples (which is not what we want as explained in the previous paragraph). Resampling from a fixed set of samples is a necessity in Sequential Monte Carlo methods as the samples are time (sequence) dependent and therefore new samples for the current time cannot be generated without starting from time zero. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the example! I have just a couple more clarifying questions, whose answers I think could make MHResampler
easier for users to understand.
Background
This pull request introduces a resampler for weighed samples that creates equally weighed samples from the distribution specified by the generator of the weighed samples (see item 3 here).
Implementation
guide
is used as a proposal distribution which is independent of the current sample.Notes
guide
perfectly tracks themodel
this sampler will do nothing as the Metropolis-Hastings algorithm will have an acceptance probability of one for new samples.guide
that would otherwise take many optimization iterations to converge or not converge at all (this is demonstrated in the tests of this module).