API Reference


plot_autocorr(data[, var_names, max_lag, …])

Bar plot of the autocorrelation function for a sequence of data.

plot_compare(comp_df[, insample_dev, …])

Summary plot for model comparison.

plot_density(data[, group, data_labels, …])

Generate KDE plots for continuous variables and histograms for discrete ones.

plot_dist(values[, values2, color, kind, …])

Plot distribution as histogram or kernel density estimates.

plot_elpd(compare_dict[, color, xlabels, …])

Plot a scatter or hexbin matrix of the sampled parameters.

plot_energy(data[, kind, bfmi, figsize, …])

Plot energy transition distribution and marginal energy distribution in HMC algorithms.

plot_ess(idata[, var_names, kind, relative, …])

Plot quantile, local or evolution of effective sample sizes (ESS).

plot_forest(data[, kind, model_names, …])

Forest plot to compare credible intervals from a number of distributions.

plot_hpd(x, y[, credible_interval, color, …])

Plot hpd intervals for regression data.

plot_joint(data[, group, var_names, …])

Plot a scatter or hexbin of two variables with their respective marginals distributions.

plot_kde(values[, values2, cumulative, rug, …])

1D or 2D KDE plot taking into account boundary conditions.

plot_khat(khats[, color, xlabels, …])

Plot Pareto tail indices.

plot_loo_pit([idata, y, y_hat, log_weights, …])

Plot Leave-One-Out (LOO) probability integral transformation (PIT) predictive checks.

plot_mcse(idata[, var_names, coords, …])

Plot quantile or local Monte Carlo Standard Error.

plot_pair(data[, group, var_names, coords, …])

Plot a scatter, kde and/or hexbin matrix with (optional) marginals on the diagonal.

plot_parallel(data[, var_names, coords, …])

Plot parallel coordinates plot showing posterior points with and without divergences.

plot_posterior(data[, var_names, transform, …])

Plot Posterior densities in the style of John K.

plot_ppc(data[, kind, alpha, mean, figsize, …])

Plot for posterior/prior predictive checks.

plot_rank(data[, var_names, transform, …])

Plot rank order statistics of chains.

plot_trace(data, var_names, …[, ax])

Plot distribution (histogram or kernel density estimates) and sampled values.

plot_violin(data[, var_names, transform, …])

Plot posterior of traces as violin plot.


apply_test_function(idata, func[, group, …])

Apply a Bayesian test function to an InferenceData object.

compare(dataset_dict[, ic, method, …])

Compare models based on PSIS-LOO loo or WAIC waic cross-validation.

hpd(ary[, credible_interval, circular, …])

Calculate highest posterior density (HPD) of array for given credible_interval.

loo(data[, pointwise, reff, scale])

Pareto-smoothed importance sampling leave-one-out cross-validation.

loo_pit([idata, y, y_hat, log_weights])

Compute leave one out (PSIS-LOO) probability integral transform (PIT) values.

psislw(log_weights[, reff])

Pareto smoothed importance sampling (PSIS).

r2_score(y_true, y_pred)

R² for Bayesian regression models.

summary(data, var_names, NoneType] = None, …)

Create a data frame with summary statistics.

waic(data[, pointwise, scale])

Calculate the widely available information criterion.



Calculate the estimated Bayesian fraction of missing information (BFMI).

geweke(ary[, first, last, intervals])

Compute z-scores for convergence diagnostics.

ess(data, \*[, var_names, method, relative, …])

Calculate estimate of the effective sample size.

rhat(data, \*[, var_names, method])

Compute estimate of rank normalized splitR-hat for a set of traces.

mcse(data, \*[, var_names, method, prob])

Calculate Markov Chain Standard Error statistic.

Stats utils

autocov(ary[, axis])

Compute autocovariance estimates for every lag for the input array.

autocorr(ary[, axis])

Compute autocorrelation using FFT for every lag for the input array.

make_ufunc(func[, n_dims, n_output, …])

Make ufunc from a function taking 1D array input.

wrap_xarray_ufunc(ufunc, \*datasets[, …])

Wrap make_ufunc with xarray.apply_ufunc.



Container for inference data storage using xarray.

convert_to_inference_data(obj, \*[, group, …])

Convert a supported object to an InferenceData object.

load_arviz_data([dataset, data_home])

Load a local or remote pre-made dataset.

to_netcdf(data, filename, \*[, group, …])

Save dataset as a netcdf file.


Load netcdf file back into an arviz.InferenceData.

from_cmdstan(posterior, List[str], …)

Convert CmdStan data into an InferenceData object.

from_cmdstanpy([posterior, …])

Convert CmdStanPy data into an InferenceData object.

from_dict([posterior, posterior_predictive, …])

Convert Dictionary data into an InferenceData object.

from_emcee([sampler, var_names, slices, …])

Convert emcee data into an InferenceData object.

from_pymc3(trace, NoneType] = None, \*, …)

Convert pymc3 data into an InferenceData object.

from_pymc3_predictions(predictions, …[, …])

Translate out-of-sample predictions into InferenceData.

from_pyro([posterior, prior, …])

Convert Pyro data into an InferenceData object.

from_numpyro([posterior, prior, …])

Convert NumPyro data into an InferenceData object.

from_pystan([posterior, …])

Convert PyStan data into an InferenceData object.

from_tfp([posterior, var_names, model_fn, …])

Convert tfp data into an InferenceData object.

concat(\*args[, dim, copy, inplace, reset_dim])

Concatenate InferenceData objects.



A class to toggle numba states.


Context manager to change backend temporarily in ipython sesson.


rc_context([rc, fname])

Return a context manager for managing rc settings.


Experimental feature

SamplingWrapper(model[, idata_orig, …])

Class wrapping sampling routines for its usage via ArviZ.

PyStanSamplingWrapper(model[, idata_orig, …])

PyStan sampling wrapper base class.

Stats (requiring refitting)

Experimental feature

reloo(wrapper[, loo_orig, k_thresh, scale, …])

Recalculate exact Leave-One-Out cross validation refitting where the approximation fails.