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

Allow simultaneous sampling and boundaries for nested random walk sampler #49

Merged
merged 13 commits into from
Aug 21, 2024

Conversation

edknock
Copy link
Contributor

@edknock edknock commented Jul 25, 2024

No description provided.

Copy link

codecov bot commented Jul 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (b3ee2b7) to head (7f2d7fe).
Report is 14 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #49   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           61        61           
  Lines         4050      4142   +92     
=========================================
+ Hits          4050      4142   +92     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +235 to +237
## If e.g. density is provided by a particle filter, would this bit
## mean rerunning it? Increases time cost if so, and would result in
## new value of density (different to that which was accepted)
Copy link
Member

Choose a reason for hiding this comment

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

I think it does really, which leaves us in a bit of a pickle. Options here:

  1. forbid this when the model is stochastic
  2. allow a model to advertise itself as additive (though some subtleties with the prior here)
  3. add a new method that nested models must provide that allows them to replace new groups (in effect moving this part into the model)

I think the latter is the best option, and something we can discuss when we're both back?

Copy link
Member

Choose a reason for hiding this comment

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

I've put this down as mrc-5699

})


test_that("can run nested random walk sampler with rejecting boundaries
Copy link
Member

Choose a reason for hiding this comment

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

Probably we need tests of some of the lower level bits in the sampler too here, particularly around the details of rejecting just some samples?

i_group <- model$parameter_groups %in% which(!i)
pars_next[i_group] <- state$pars[i_group]
}
density_next <- model$density(pars_next, by_group = TRUE)
Copy link
Member

Choose a reason for hiding this comment

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

You can now use index_group to run a subset here

Copy link
Member

Choose a reason for hiding this comment

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

actually this needs support from dust too (mrc-5701, mrc-5700)

R/sampler-nested-random-walk.R Outdated Show resolved Hide resolved
Copy link
Member

@richfitz richfitz left a comment

Choose a reason for hiding this comment

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

Bits to pick up on, but #46 naturally does that

@richfitz richfitz merged commit e974ffa into main Aug 21, 2024
8 checks passed
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