ArviZ.jl - Exploratory analysis of Bayesian models in Julia for CmdStan.jl and StanSample.jl

Hi everyone,

I’m pleased to announce that I’ve just released ArviZ.jl, a Julia wrapper for the Python library ArviZ for exploratory analysis of Bayesian models.

ArviZ.jl supports Julia’s Stan wrappers CmdStan.jl and StanSample.jl.

Example usage:

using ArviZ, CmdStan
proj_dir = 
data = ...
stan_model = Stanmodel(...)
_, chns, _ = stan(stan_model, data)
inference_data = from_cmdstan(chns)
summary(inference_data)
plot_trace(inference_data)

It also provides support for other Julia PPLs such as the universal PPL Turing.jl, with others on the way.

12 Likes

Very cool, thanks for sharing!

Do you happen to know if it is possible to wrap R plotting packages in a similar way?

It should be possible using RCall.jl. A quick search brought up this blog post with an example. I’ve not used RCall myself, so I don’t know if it’s as seamless as PyCall. Python’s syntax looks more similar to Julia’s than R’s does.

3 Likes

@jonah Were you thinking of something like bayesplot?

1 Like

Among other things, yeah!

1 Like

@jonah I think this might be possible with gadfly.jl. It’s the native Julia package that is based in terms of aesthetics (no pun intended) on ggplot2. It might be easier to do this with gadfly versus dealing with other plotting packages in Julia that are just calling pyplot/matplotlib. This can be done better now as I think some of the difficulty he has mentioned comes from just knowing both systems of plotting and style specification for each plot. If a user were to come from just using Julia, I’m not sure they would see the difference in style of how layers are being built with each plot. Also maybe a user is just looking for some basic plots which can be called without much in terms of data wrangling and also starting with some style choices that we default to but if the user wants to specify different colors or plot size we can incorporate afterward.

1 Like

I’ll try and create a Julia wrapper package for the bayesplot package in R; first to compare and see if there its much better to just use the RCall feature in julia or create a full Julia equivalent with gadfly. I imagine it’s way less overhead but I don’t know what headaches there might be if any. So I’ll let everyone know in separate post.

3 Likes