How to use the arviz.style 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_energy.py View on Github external
"""
Energy Plot
===========

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

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

data = az.load_arviz_data("centered_eight")
az.plot_energy(data, figsize=(12, 8))
github arviz-devs / arviz / examples / matplotlib / mpl_plot_violin.py View on Github external
"""
Violinplot
==========

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

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

data = az.load_arviz_data("non_centered_eight")
az.plot_violin(data, var_names=["mu", "tau"])
github arviz-devs / arviz / examples / matplotlib / mpl_plot_rank.py View on Github external
"""
Rank plot
=========

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

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

data = az.load_arviz_data("centered_eight")
az.plot_rank(data, var_names=("tau", "mu"))
github arviz-devs / arviz / examples / compareplot.py View on Github external
"""
Compare Plot
============

_thumb: .5, .5
"""
import arviz as az
import numpy as np
import pymc3 as pm

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

# Data of the Eight Schools Model
J = 8
y = np.array([28.,  8., -3.,  7., -1.,  1., 18., 12.])
sigma = np.array([15., 10., 16., 11.,  9., 11., 10., 18.])


with pm.Model('Centered Eight Schools') as centered_eight:
    mu = pm.Normal('mu', mu=0, sd=5)
    tau = pm.HalfCauchy('tau', beta=5)
    theta = pm.Normal('theta', mu=mu, sd=tau, shape=J)
    obs = pm.Normal('obs', mu=theta, sd=sigma, observed=y)
    centered_eight_trace = pm.sample()


with pm.Model('Non-Centered Eight Schools') as non_centered:
github arviz-devs / arviz / examples / matplotlib / mpl_plot_forest.py View on Github external
"""
Forest Plot
===========

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

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

centered_data = az.load_arviz_data("centered_eight")
non_centered_data = az.load_arviz_data("non_centered_eight")
axes = az.plot_forest(
    [centered_data, non_centered_data], model_names=["Centered", "Non Centered"], var_names=["mu"]
)
axes[0].set_title("Estimated theta for eight schools model")
github arviz-devs / arviz / examples / matplotlib / mpl_plot_parallel.py View on Github external
"""
Parallel Plot
=============

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

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

data = az.load_arviz_data("centered_eight")
ax = az.plot_parallel(data, var_names=["theta", "tau", "mu"])
ax.set_xticklabels(ax.get_xticklabels(), rotation=70)
github arviz-devs / arviz / examples / parallelplot.py View on Github external
"""
Parallel Plot
=============

_thumb: .2, .5
"""
import arviz as az
import numpy as np
import pymc3 as pm

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

# Data of the Eight Schools Model
J = 8
y = np.array([28.,  8., -3.,  7., -1.,  1., 18., 12.])
sigma = np.array([15., 10., 16., 11.,  9., 11., 10., 18.])


with pm.Model() as centered_eight:
    mu = pm.Normal('mu', mu=0, sd=5)
    tau = pm.HalfCauchy('tau', beta=5)
    theta = pm.Normal('theta', mu=mu, sd=tau, shape=J)
    obs = pm.Normal('obs', mu=theta, sd=sigma, observed=y)
    centered_eight_trace = pm.sample()

az.parallelplot(centered_eight_trace, var_names=['theta', 'tau', 'mu'])
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_ppc.py View on Github external
"""
Posterior Predictive Check Plot
===============================

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

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

data = az.load_arviz_data("non_centered_eight")
az.plot_ppc(data, alpha=0.03, figsize=(12, 6), textsize=14)
github arviz-devs / arviz / examples / matplotlib / mpl_plot_ppc_cumulative.py View on Github external
"""
Posterior Predictive Check Cumulative Plot
==========================================

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

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

data = az.load_arviz_data("non_centered_eight")
az.plot_ppc(data, alpha=0.3, kind="cumulative", figsize=(12, 6), textsize=14)