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

Commonly used adaptation methods #20

Merged
merged 2 commits into from Aug 7, 2017

Conversation

Projects
None yet
3 participants
@LeahPrice
Collaborator

LeahPrice commented Aug 7, 2017

Adding a class containing commonly used parameters and methods to adapt them (for static Bayesian models).

Commonly used adaptation methods
Adding a class containing commonly used parameters and methods to adapt them (for static Bayesian models).
@eddelbuettel

Nice -- you are clearly getting the drift of incremental value-added PRs. We're in a good spot now.

I'll wait for Adam to peek at this tomorrow though before I merge.

@adamjohansen

This looks good to me.

There are a few small things it might make sense to tweak, particularly in the acceptProb comparisons (not that I'd expect these to have any significant impact).

Show outdated Hide outdated src/staticModelAdapt.cpp
Show outdated Hide outdated src/staticModelAdapt.cpp
/// \param desiredAcceptProb The desired probability of a successful move for each particle.
/// \param initialN The initial number of MCMC repeats.
/// \param maxReps The maximum number of MCMC repeats.
int staticModelAdapt::calcMcmcRepeats(double acceptProb, double desiredAcceptProb, int initialN, int maxReps){

This comment has been minimized.

@adamjohansen

adamjohansen Aug 7, 2017

Collaborator

It's a bad idea to compare doubles with integers using ==, usually (the finite precision issue), might it make sense to replace these comparisons with
abs(acceptProb - 1) <= 10**-9
or similar?

@adamjohansen

adamjohansen Aug 7, 2017

Collaborator

It's a bad idea to compare doubles with integers using ==, usually (the finite precision issue), might it make sense to replace these comparisons with
abs(acceptProb - 1) <= 10**-9
or similar?

@adamjohansen

This comment has been minimized.

Show comment
Hide comment
@adamjohansen

adamjohansen Aug 7, 2017

Collaborator

Great, thanks.

Collaborator

adamjohansen commented Aug 7, 2017

Great, thanks.

@eddelbuettel eddelbuettel merged commit 6ff9b33 into rcppsmc:master Aug 7, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@LeahPrice LeahPrice deleted the LeahPrice:StaticModelAdaptation branch Aug 7, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment