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

Plotter for MCMC diagnostics #146

Merged
merged 18 commits into from
Mar 6, 2024
Merged

Plotter for MCMC diagnostics #146

merged 18 commits into from
Mar 6, 2024

Conversation

zihaoxu98
Copy link
Collaborator

@zihaoxu98 zihaoxu98 commented Mar 4, 2024

This PR adds a class called Plotter, which can generate the needed plots to diagnose MCMC result. Currently, there are four plots: burn-in, marginal posterior, corner, and auto corr plot for convergence check (see emcee doc)

To use it,

from appletree import Plotter

file_name = '/project2/lgrandi/mhliu0001/ambe_fit_backend/fit_ambe_sr0_with_outliers.h5'
plotter = Plotter(file_name)
plotter.make_all_plots()

Note that a long iteration will slow down the plotting, especially the corner plot.

@coveralls
Copy link

coveralls commented Mar 5, 2024

Pull Request Test Coverage Report for Build 8168645414

Details

  • 190 of 202 (94.06%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+1.3%) to 85.075%

Changes Missing Coverage Covered Lines Changed/Added Lines %
appletree/plot.py 188 200 94.0%
Totals Coverage Status
Change from base Build 8158759385: 1.3%
Covered Lines: 2263
Relevant Lines: 2660

💛 - Coveralls

@zihaoxu98 zihaoxu98 marked this pull request as ready for review March 5, 2024 22:20
@zihaoxu98 zihaoxu98 requested a review from dachengx March 5, 2024 22:20
Copy link
Collaborator

@dachengx dachengx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @zihaoxu98 . This is a feature we wanted for a long time. Just a few minor points needed more revising.

appletree/plot.py Show resolved Hide resolved
appletree/plot.py Outdated Show resolved Hide resolved
appletree/plot.py Show resolved Hide resolved
appletree/plot.py Outdated Show resolved Hide resolved
appletree/plot.py Outdated Show resolved Hide resolved
appletree/plot.py Outdated Show resolved Hide resolved
@dachengx
Copy link
Collaborator

dachengx commented Mar 6, 2024

I added some tests of the plotting function.

@dachengx dachengx merged commit b064bda into master Mar 6, 2024
7 checks passed
@dachengx dachengx deleted the plotter branch March 6, 2024 07:59
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

Successfully merging this pull request may close these issues.

3 participants