How to use the arviz.load_arviz_data function in arviz

To help you get started, we’ve selected a few arviz examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github arviz-devs / arviz / examples / matplotlib / mpl_plot_loo_pit_overlay.py View on Github external
"""
LOO-PIT Overlay Plot
====================

_thumb: .5, .7
"""
import arviz as az

az.style.use("arviz-darkgrid")

idata = az.load_arviz_data("non_centered_eight")

az.plot_loo_pit(idata=idata, y="obs", color="indigo")
github arviz-devs / arviz / examples / matplotlib / mpl_plot_loo_pit_ecdf.py View on Github external
"""
LOO-PIT ECDF Plot
=================

_thumb: .5, .7
"""
import arviz as az

az.style.use("arviz-darkgrid")

idata = az.load_arviz_data("radon")
log_like = idata.sample_stats.log_likelihood.sel(chain=0).values.T
log_weights = az.psislw(-log_like)[0]

az.plot_loo_pit(idata, y="y_like", log_weights=log_weights, ecdf=True, color="maroon")
github arviz-devs / arviz / examples / bokeh / bokeh_plot_mcse_errorbar.py View on Github external
"""
Quantile MCSE Errobar Plot
==========================

_thumb: .6, .4
"""
import arviz as az

data = az.load_arviz_data("radon")
ax = az.plot_mcse(data, var_names=["sigma_a"], color="red", errorbar=True, backend="bokeh")
github arviz-devs / arviz / examples / bokeh / bokeh_plot_forest.py View on Github external
"""
Forest Plot
===========

_thumb: .5, .8
"""
import arviz as az

centered_data = az.load_arviz_data("centered_eight")
non_centered_data = az.load_arviz_data("non_centered_eight")
ax = az.plot_forest(
    [centered_data, non_centered_data],
    model_names=["Centered", "Non Centered"],
    var_names=["mu"],
    backend="bokeh",
)
github arviz-devs / arviz / examples / bokeh / bokeh_plot_forest_ridge.py View on Github external
"""
Ridgeplot
=========

_thumb: .8, .5
"""
import arviz as az

rugby_data = az.load_arviz_data("rugby")
ax = az.plot_forest(
    rugby_data,
    kind="ridgeplot",
    var_names=["defs"],
    linewidth=4,
    combined=True,
    ridgeplot_overlap=1.5,
    colors="blue",
    figsize=(9, 4),
    backend="bokeh",
)
github pymc-devs / pymc3 / api / plots-15.py View on Github external
import arviz as az
model_compare = az.compare({'Centered 8 schools': az.load_arviz_data('centered_eight'),
                 'Non-centered 8 schools': az.load_arviz_data('non_centered_eight')})
az.plot_compare(model_compare)
github arviz-devs / arviz / examples / matplotlib / mpl_plot_pair.py View on Github external
"""
Pair Plot
=========

_thumb: .2, .5
"""
import arviz as az

az.style.use("arviz-darkgrid")

centered = az.load_arviz_data("centered_eight")

coords = {"school": ["Choate", "Deerfield"]}
az.plot_pair(
    centered, var_names=["theta", "mu", "tau"], coords=coords, divergences=True, textsize=22
)
github arviz-devs / arviz / examples / matplotlib / mpl_plot_trace.py View on Github external
"""
Traceplot
=========

_thumb: .1, .8
"""
import arviz as az

az.style.use("arviz-darkgrid")

data = az.load_arviz_data("non_centered_eight")
az.plot_trace(data, var_names=("tau", "mu"))
github arviz-devs / arviz / examples / matplotlib / mpl_plot_elpd.py View on Github external
"""
ELPD Plot
=========

_thumb: .6, .5
"""
import arviz as az

az.style.use("arviz-darkgrid")

d1 = az.load_arviz_data("centered_eight")
d2 = az.load_arviz_data("non_centered_eight")

az.plot_elpd({"Centered eight": d1, "Non centered eight": d2}, xlabels=True)
github arviz-devs / arviz / examples / matplotlib / mpl_plot_kde.py View on Github external
"""
KDE Plot
========

_thumb: .2, .8
"""
import arviz as az
import numpy as np

az.style.use("arviz-darkgrid")

data = az.load_arviz_data("centered_eight")

# Combine posterior draws for from xarray of (4,500) to ndarray (2000,)
y_hat = np.concatenate(data.posterior_predictive["obs"].values)

ax = az.plot_kde(
    y_hat,
    label="Estimated Effect\n of SAT Prep",
    rug=True,
    plot_kwargs={"linewidth": 2, "color": "black"},
    rug_kwargs={"color": "black"},
)