Conversation
edknock
reviewed
Sep 26, 2025
tests/testthat/helper-monty.R
Outdated
| ## This recalculates the *old* density, per group. For an | ||
| ## expensive model that might not be ideal. | ||
| density <- likelihood_fn(p, m1, m2, x, z) | ||
| p_accept <- pmin(1, exp(density_new - density)) |
Contributor
There was a problem hiding this comment.
proposal is not symmetric so you need to account for this in the acceptance probability, it should be something like
proposal_ratio <- z * log(p_group_1) + (1 - z) * log(1 - p_group_1) -
z_new * log(p_group_1) - (1 - z_new) * log(1 - p_group_1)
p_accept <- pmin(1, exp(density_new - density + proposal_ratio))
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #176 +/- ##
========================================
Coverage 99.92% 99.92%
========================================
Files 70 70
Lines 5458 5573 +115
========================================
+ Hits 5454 5569 +115
Misses 4 4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
|
I have set this up so that parallel tempering or HMC do not support augmented data - they could do in future but would need a bit more of a think about how they work. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.