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_energy(data[, kind, bfmi, figsize, …])

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

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[, var_names, coords, …])

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[, figsize, textsize, …])

Plot Pareto tail indices.

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

Plot a scatter or hexbin matrix of the sampled parameters.

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

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

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

Plot Posterior densities in the style of John K.

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

Plot for posterior predictive checks.

plot_rank(data[, var_names, coords, bins, …])

Plot rank order statistics of chains.

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

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



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

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

Compare models based on WAIC or LOO cross validation.

hpd(x[, 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.

r2_score(y_true, y_pred)

R² for Bayesian regression models.

summary(data[, var_names, fmt, round_to, …])

Create a data frame with summary statistics.

waic(data[, pointwise, scale])

Calculate the widely available information criterion.

psislw(log_weights[, reff])

Pareto smoothed importance sampling (PSIS).


effective_sample_size(data, \*[, var_names])

Calculate estimate of the effective sample size.

rhat(data[, var_names])

Compute estimate of Split R-hat for a set of traces.

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

Compute z-scores for convergence diagnostics.


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


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, …])

Convert CmdStan data into an InferenceData object.

from_dict([posterior, posterior_predictive, …])

Convert Dictionary data into an InferenceData object.

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

Convert emcee data into an InferenceData object.

from_pymc3([trace, prior, …])

Convert pymc3 data into an InferenceData object.

from_pyro([posterior, coords, dims])

Convert pyro data into an InferenceData object.

from_pystan([posterior, …])

Convert PyStan data into an InferenceData object.