ArviZ.jl is a Julia interface to the ArviZ package for exploratory analysis of Bayesian models.
This documentation will focus on differences between ArviZ.jl and ArviZ, applications using Julia's probabilistic programming languages (PPLs), and examples in Julia.
Besides removing the need to explicitly import ArviZ with PyCall.jl, ArviZ.jl extends ArviZ with functionality for converting Julia types into ArviZ's
InferenceData format. It also allows smoother usage with PyPlot.jl and provides functions that can be overloaded by other packages to enable their types to be used with ArviZ.
To use with the default Python environment, first install ArviZ. Then in Julia's REPL run
] add ArviZ
To install ArviZ.jl with its Python dependencies in Julia's private conda environment, in the console run
PYTHON="" julia -e 'using Pkg; Pkg.add("PyCall"); Pkg.build("PyCall"); Pkg.add("ArviZ")'
For specifying other Python versions, see the PyCall documentation.
ArviZ.jl wraps ArviZ's API functions and closely follows ArviZ's design. It also supports conversion of MCMCChains.jl's
Chains as returned by Turing.jl, CmdStan.jl, StanSample.jl, and others into ArviZ's
InferenceData format. See Quickstart for examples.
The package is intended to be used with PyPlot.jl.
ArviZ.jl development occurs on GitHub. Issues and pull requests are welcome.
In ArviZ, functions in the API are usually called with the package name prefix, (e.g.
arviz.plot_posterior). In ArviZ.jl, most of the same functions are exported and therefore can be called without the prefix (e.g.
plot_posterior). The exception are
from_xyz converters for packages that have no (known) Julia wrappers. These functions are not exported to reduce namespace clutter.
arviz.summary to avoid confusion with
Base.summary. For arbitrary inputs and the full functionality of
ArviZ.summary, which is not exported.
ArviZ.jl transparently interconverts between
arviz.InferenceData and our own
InferenceData, used for dispatch.
InferenceData has identical usage to its Python counterpart.
Functions that in ArviZ return Pandas types here return DataFrames.jl types.
ArviZ includes the context managers
interactive_backend. ArviZ.jl includes the functions
with_interactive_backend, which can be used with a nearly identical syntax.
with_interactive_backend here is not limited to an IPython/IJulia context.
ArviZ.jl uses PyCall.jl to wrap ArviZ. At the moment, Julia segfaults if Numba is imported, which ArviZ does if it is available. For the moment, the workaround is to specify a Python version that doesn't have Numba installed. See this issue for more details.