TuringLang / MCMCChains.jl

Types and utility functions for summarizing Markov chain Monte Carlo simulations
https://turinglang.org/MCMCChains.jl/
Other
268 stars 28 forks source link

Add plotting via Makie as Extension #454

Open alecloudenback opened 7 months ago

alecloudenback commented 7 months ago

Current Status:

A color-blind-friendly color scheme (:tol_vibrant) is used to plot the trance and parameter densities for each parameter in each chain.

Sample plots:

Basic Layout image

Large number of parameters image

Large number of chains image

To-do

Sample Script

julia> using MCMCChains, CairoMakie
julia> chns = Chains(randn(300, 5, 3), [:A, :B, :C, :D, :E]);
julia> myplot(chns)
codecov[bot] commented 7 months ago

Codecov Report

Attention: Patch coverage is 5.12821% with 37 lines in your changes missing coverage. Please review.

Project coverage is 81.90%. Comparing base (5f8e591) to head (20e76a4).

:exclamation: Current head 20e76a4 differs from pull request most recent head 1144212

Please upload reports for the commit 1144212 to get more accurate results.

Files Patch % Lines
ext/MCMCChainsMakieExt.jl 0.00% 37 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #454 +/- ## ========================================== - Coverage 84.70% 81.90% -2.80% ========================================== Files 20 21 +1 Lines 1072 1111 +39 ========================================== + Hits 908 910 +2 - Misses 164 201 +37 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

alecloudenback commented 7 months ago

After talking with the Makie devs on Discord:

The latest commit is the recommended approach, including registering an error hint if a Makie-related package isn't yet loaded and trace is called.

alecloudenback commented 6 months ago

@devmotion / @theogf pinging since you had some initial feedback requesting a recipes-based approach, but I don't think that works when wanted to plot multiple chains/parameters (see my last post). If good with the overall approach here, I can knock out the remaining To-Dos.