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

find_mcmc_step! modifies MCMCObj #61

Closed
ilopezgp opened this issue Jun 26, 2020 · 1 comment
Closed

find_mcmc_step! modifies MCMCObj #61

ilopezgp opened this issue Jun 26, 2020 · 1 comment
Assignees

Comments

@ilopezgp
Copy link
Contributor

The function find_mcmc_step! in MCMC.jl returns the step for optimal acceptance rate, but also advances the MCMC chain to a new state.

This will be problematic when the starting MCMC step is set to a higher value than the optimal one. The reason is that at the initial iterations of the chain, the MCMC samples will move away from the region of maximum likelihood, which may increase significantly the amount of MCMC realizations needed to obtain a well-sampled posterior.

I propose changing find_mcmc_step! to find_mcmc_step, with no modification of the arguments, by using a copy of the MCMC object.

@odunbar
Copy link
Collaborator

odunbar commented Jun 26, 2020

It was initially set up so that you use one mcmc object to find the step size and then build a new object for the actual run.

I think if you are worried about the fact it's at a new state. The easiest thing would be to store a deepcopy of u0 into the constructor (which was possibly in this code once). Which could possibly be a one-liner to fix the problem.

After this fix, a non-modifying step size selection would be a good addition!

tsj5 added a commit to tsj5/CalibrateEmulateSample.jl that referenced this issue Jan 18, 2022
Fixes CliMA#61

Addresses the concern in linked issue in that the markov chain state is
no longer saved in the MCMC[Wrapper] object, so that chains generated in
the operation of find_mcmc_step! are thrown away and don't enter into
the posterior sampling done when the MC is then sampled "for real."
@odunbar odunbar closed this as completed May 27, 2022
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

No branches or pull requests

2 participants