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

Likelihood computations with conditional resampling #16

Open
THargreaves opened this issue Oct 23, 2024 · 1 comment
Open

Likelihood computations with conditional resampling #16

THargreaves opened this issue Oct 23, 2024 · 1 comment

Comments

@THargreaves
Copy link
Collaborator

I've realised that had a misconception about how to compute the incremental marginal likelihoods at the end of each update in the presence of conditional resampling.

Chopin's book gives this formula,

image

but it's a bit clunky because it requires us to record whether resampling took place. Charles had a nice solution by noting that these formulas coincidence of we reset the weights to unity after resampling.

Since this works I've reverted back to this approach in 731d206.

I'm still a bit uncomfortable with this since really the weights after resampling should be 1/N. I'm not sure whether there is any use case where this distinction would actually matter, but it's worth thinking about. It's also worth nothing that we require an additional logsumexp which it would be nice to avoid.

@charlesknipp
Copy link
Collaborator

charlesknipp commented Oct 24, 2024

I cleaned up some of the code earlier today. I agree that the additional logsumexp is pretty annoying, but from what I can tell this is the only proper way to get consistent likelihoods.

I'm still a bit uncomfortable with this since really the weights after resampling should be 1/N

I mean, this is technically true since we softmax a set of equal log weights. Chopin even suggests setting logw = 1 in algorithm 10.3, which yield identical results since we're operating in log space.

Regardless, the newest commits in 7b10071 are now passing all most of the unit tests and the variations discussed on Slack (not counting the GPU filter).

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