Skip to content

Support a simple augmented data interface#176

Open
richfitz wants to merge 26 commits intomainfrom
mrc-6769
Open

Support a simple augmented data interface#176
richfitz wants to merge 26 commits intomainfrom
mrc-6769

Conversation

@richfitz
Copy link
Member

No description provided.

## 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))
Copy link
Contributor

@edknock edknock Sep 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link

codecov bot commented Oct 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.92%. Comparing base (53ae53f) to head (4ebd95a).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@edknock
Copy link
Contributor

edknock commented Oct 15, 2025

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.

@edknock edknock marked this pull request as ready for review October 15, 2025 14:30
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

Successfully merging this pull request may close these issues.

2 participants