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

Parameter object and adaptation #19

Merged
merged 2 commits into from Aug 6, 2017
Merged

Conversation

@LeahPrice
Copy link
Collaborator

@LeahPrice LeahPrice commented Aug 6, 2017

This commit is the start of making it easier to perform adaptation in SMC.

The main changes here are:

  • Adding a template parameter for the algorithm parameters to the sampler object
  • Creating a base class for adaptation
  • Doing the MCMC repeats within the library
This commit is the start of making it easier to perform adaptation in SMC.

The main changes here are:
- Adding a template parameter for the algorithm parameters to the sampler object
- Creating a base class for adaptation
- Changing the MCMC function to give a boolean return.
@LeahPrice
Copy link
Collaborator Author

@LeahPrice LeahPrice commented Aug 6, 2017

I changed the MCMC step a little so that the loop over the repeats is done within the library and users write code for a single MCMC step for a single particle. This seemed helpful for adapting the number of MCMC repeats (it is easier to work out the acceptance probability from previous steps if you know the number of repeats).

I think in a future pull request I’ll store more of the calculations for data annealing SMC. I’m essentially doubling up on the likelihood and prior calculations because I’m recalculating them for the current particle at every iteration.

Copy link
Collaborator

@eddelbuettel eddelbuettel left a comment

Sounds good on the SMC methodology extension.

I just have a technical nag I'd like you to fix.

@@ -2,26 +2,26 @@
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

blockpfGaussianOpt_impl <- function(data, part, lag) {
.Call(`_RcppSMC_blockpfGaussianOpt_impl`, data, part, lag)
.Call('RcppSMC_blockpfGaussianOpt_impl', PACKAGE = 'RcppSMC', data, part, lag)

This comment has been minimized.

@eddelbuettel

eddelbuettel Aug 6, 2017
Collaborator

You are using an Rcpp version older than 0.12.12.

Please upgrade, and re-create the file, or explain why you must use on old version, possibly over at the Rcpp repo with an issue ticket there.

This comment has been minimized.

@LeahPrice

LeahPrice Aug 6, 2017
Author Collaborator

Thanks for picking up on that. I've fixed it up now.

This comment has been minimized.

@eddelbuettel

eddelbuettel Aug 6, 2017
Collaborator

Thanks.

* src/RcppExports.cpp: Regenerated.
* R/RcppExports.R: Idem.

2017-08-04 Adam M. Johansen <adam.johansen@gmail.com>

This comment has been minimized.

@eddelbuettel

eddelbuettel Aug 6, 2017
Collaborator

Thanks for cleaning that up.

@eddelbuettel eddelbuettel merged commit e953543 into rcppsmc:master Aug 6, 2017
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@adamjohansen
Copy link
Collaborator

@adamjohansen adamjohansen commented Aug 6, 2017

Thanks, both -- looks good.

@LeahPrice LeahPrice deleted the LeahPrice:SetUpAdaptation branch Aug 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.