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

Walkers Initialization in Basic Use Examples: Shouldn't these use Uniform Distribution? #7

Open
AdityaSavara opened this issue Oct 6, 2020 · 1 comment

Comments

@AdityaSavara
Copy link

AdityaSavara commented Oct 6, 2020

In the basic use example ( https://zeus-mcmc.readthedocs.io/en/latest/ ) currently there is this line:

start = np.random.randn(nwalkers, ndim)
https://zeus-mcmc.readthedocs.io/en/latest/index.html
Also here:
https://zeus-mcmc.readthedocs.io/en/latest/notebooks/datafit.html

I copied that for how zeus is initialized in my code. But isn’t it wrong? If you use standard distribution you are biasing the starting points. Even burn in probably should not completely remove the effects of bias.

I think that probably we probably want something like this:

start = 4*(np.random.rand(nwalkers, ndim)-0.5)

That way we get initialization from a bounded uniform distribution from -2 standard deviations to +2 standard deviations.

I have tried both ways in my code ( link ) and they give similar results.
I have switched to the uniform way in in my code. Like below.

walkerStartsFirstTerm = 4*(np.random.rand(nwalkers, numParameters)-0.5) 
walkerStartPoints = walkerStartsFirstTerm*std_prior + mean_prior

Edit: the FAQ suggests starting the walkers in a ball near the MAP, so maybe this is okay. https://zeus-mcmc.readthedocs.io/en/latest/faq.html Also, that may mean for some problems it is better to start with a posterior maximizing routine (such as Metropolis Hastings MCMC or Nelder-Mead) followed by Ensemble Slice Sampling.

@yuanzunli
Copy link

@minaskar Dear Minas, I just test zeus with my MCMC problem. It runs very well. But I have a question: it seems that zeus is very similar with another MCMC programmer 'emcee', including its function format, some basic usage... So what's the zeus's advantage over emcee?

@minaskar minaskar mentioned this issue Mar 26, 2021
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