A new library to consume your fitting chains! Produce likelihood surfaces, plot your walks to check convergence, or even output a LaTeX table of the marginalised parameter distributions with uncertainties and significant figures all done for you!
Click through to the online documentation
import numpy as np
from chainconsumer import ChainConsumer
mean = [0.0, 4.0]
data = np.random.multivariate_normal(mean, [[1.0, 0.7], [0.7, 1.5]], size=100000)
c = ChainConsumer()
c.add_chain(data, parameters=["$x_1$", "$x_2$"])
c.plot(filename="example.png", figsize="column", truth=mean)
You can plot walks:
c.plot_walks(filename="walks.png")
And finally, you can also create LaTeX tables:
print(c.get_latex_table())
Which compiles to something as shown below:
Install via pip
:
pip install chainconsumer
Users that wish to contribute to this project may do so in a number of ways. Firstly, for any feature requests, bugs or general ideas, please raise an issue via Github.
If you wish to contribute code to the project, please simple fork the project on Github and then raise a pull request. Pull requests will be reviewed to determine whether the changes are major or minor in nature, and to ensure all changes are tested.
For those that use ChainConsumer and would like to reference it, the following BibTeX is generated from the JOSS article:
@article{Hinton2016,
doi = {10.21105/joss.00045},
url = {http://dx.doi.org/10.21105/joss.00045},
year = {2016},
month = {aug},
publisher = {The Open Journal},
volume = {1},
number = {4},
author = {Samuel Hinton},
title = {{ChainConsumer}},
journal = {{JOSS}}
}
Please feel free to fork the project and open pull-requests, or raise an issue via Github if any bugs are encountered or features requests thought up.
- Improving text labels again
- Improving text labels for high value data.
- Adding Gelman-Rubin and Geweke diagnostic methods.
- Adding options for alternate statistics.
- Updating setup so that dependencies are automatically installed.
- Modifying the
add_chain
API, so that you can pass dictionaries!
- Smarter extent tick labels and offsets.
- Adding list based line styles, widths, shading and opacity.
- Adding two more examples.
- Preconfiguring logging.
- Adding 2D Gaussian smoothing for the contour surfaces.
- Renaming
contourf
andcontourf_alpha
toshade
andshade_alpha
. - Updating some of the example plots.
- Updating package setup scripts.
- Updating package setup scripts.
- Adding markdown paper.
- Updating setup and package details
- Initial zenodo release
- Adding in smoothing, making it default
- Adding extra example to show how to remove smoothing.
- Adding in tests
- Initial PyPi push