Skip to content

Commit

Permalink
rename, add example
Browse files Browse the repository at this point in the history
  • Loading branch information
aloctavodia committed Dec 15, 2024
1 parent 6a45812 commit a23d3fc
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 9 deletions.
25 changes: 25 additions & 0 deletions docs/source/gallery/inference_diagnostics/plot_convergence_dist.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""
# Convergence diagnostics distribution plot
Plot the distribution of ESS and R-hat.
---
:::{seealso}
API Documentation: {func}`~arviz_plots.plot_ess`
:::
"""

from arviz_base import load_arviz_data

import arviz_plots as azp

azp.style.use("arviz-clean")

data = load_arviz_data("radon")
pc = azp.plot_ess(
data,
var_names=["za_county"],
backend="none", # change to preferred backend
)
pc.show()
4 changes: 2 additions & 2 deletions src/arviz_plots/plots/__init__.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
"""Batteries-included ArviZ plots."""

from .compareplot import plot_compare
from .convergencedistplot import plot_convergence_dist
from .distplot import plot_dist
from .essplot import plot_ess
from .evolutionplot import plot_ess_evolution
from .forestplot import plot_forest
from .noseplot import plot_nose
from .psensedistplot import plot_psense_dist
from .ridgeplot import plot_ridge
from .tracedistplot import plot_trace_dist
from .traceplot import plot_trace

__all__ = [
"plot_compare",
"plot_convergence_dist",
"plot_dist",
"plot_forest",
"plot_trace",
Expand All @@ -21,5 +22,4 @@
"plot_ess_evolution",
"plot_ridge",
"plot_psense_dist",
"plot_nose",
]
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Nose plot code."""
"""Convergence diagnostic distribution plot code."""
import warnings

from arviz_base import convert_to_dataset, rcParams
Expand All @@ -7,7 +7,7 @@
from arviz_plots.plots.utils import process_group_variables_coords


def plot_nose(
def plot_convergence_dist(
dt,
diagnostics=None,
ref_line=True,
Expand All @@ -28,7 +28,7 @@ def plot_nose(
stats_kwargs=None,
pc_kwargs=None,
):
"""Plot the distribution of ESS and R-hat.
"""Plot the distribution of convergence diagnostics (ESS and/or R-hat).
Parameters
----------
Expand Down Expand Up @@ -92,24 +92,24 @@ def plot_nose(
.. plot::
:context: close-figs
>>> from arviz_plots import plot_nose, style
>>> from arviz_plots import plot_convergence_dist, style
>>> style.use("arviz-clean")
>>> from arviz_base import load_arviz_data
>>> rugby = load_arviz_data('radon')
>>> plot_nose(radon, var_names=["za_county"], diagnostics=["rhat", "ess_tail"])
>>> plot_convergence_dist(radon, var_names=["za_county"], diagnostics=["rhat", "ess_tail"])
Some ess methods accepts a probability argument
.. plot::
:context: close-figs
>>> plot_nose(radon, var_names=["za_county"],
>>> plot_convergence_dist(radon, var_names=["za_county"],
diagnostics=["ess_tail(0.1, 0.9)",
"ess_local(0.1, 0.9)",
"ess_quantile(0.9)"])
.. minigallery:: plot_nose
.. minigallery:: plot_convergence_dist
"""
if sample_dims is None:
Expand Down

0 comments on commit a23d3fc

Please sign in to comment.