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
Add MCMC module for 1DLA parameter search #10
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This reverts commit cfd0e6f. this should not be pushed to the repo. excluding data/ will cause some problems in data/scripts
…o use the mcmc method
Current Usage:For example, you want to do mcmc on this example in the paper Ho-Bird-Garnett 2020: from tests.test_model import prepare_dla_model
from examples.plot_mcmc import plot_corner, plot_sample_this_mu
# prepare a DLA model conditioned on a given spectrum
dla_gp = prepare_dla_model(plate=5309, mjd=55929, fiber_id=362, z_qso=3.166)
# number of samples you would like to sample in MCMC chains
nsamples = 10000
# number of burn-in samples you would like to discard in your MCMC chains
discard = 2000
# sampling DLA parameters using Markov Chain Monte Carlo
# nwalkers is the number of chains you would like to have. details refer to emcee website.
# kth_dla now only supports 1
sampler = dla_gp.run_mcmc(nwalkers=32, kth_dla=1, nsamples=nsamples)
# plot the sampling results from your MCMC chain. You can set the desired zDLA range
# using min_z and max_z
plot_corner(sampler, discard=discard, min_z=2.6, max_z=5.0) plot_corner(sampler, discard=discard, min_z=2.0, max_z=2.6) # plot the dla model with multiple MCMC samples, showing the probabilistic detection of DLAs
plot_sample_this_mu(dla_gp, sampler, discard=discard) |
Merge zestimation parts to MCMC branch
Add civ doublet profile
Merge for now. Added features:
Not implement:
So CIV module only supports using MCMC. Details see in the notebook. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Additions:
Todo