API Reference

Plots

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_elpd(compare_dict[, color, xlabels, …])

Plot a scatter or hexbin matrix of the sampled parameters.

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.

Stats

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

Compare models based on WAIC or LOO 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.

psislw(log_weights[, reff])

Pareto smoothed importance sampling (PSIS).

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.

Diagnostics

bfmi(data)

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.

effective_sample_size(data, \*[, var_names, …])

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.

Data

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.

from_netcdf(filename)

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

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.