forked from arviz-devs/arviz-plots
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path02_plot_dist_kde.py
More file actions
29 lines (23 loc) · 757 Bytes
/
02_plot_dist_kde.py
File metadata and controls
29 lines (23 loc) · 757 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
"""
# Posterior KDEs
KDE plot of the variable `mu` from the centered eight model. The `sample_dims` parameter is
used to restrict the KDE computation along the `draw` dimension only.
---
:::{seealso}
API Documentation: {func}`~arviz_plots.plot_dist`
EABM chapter on [Visualization of Random Variables with ArviZ](https://arviz-devs.github.io/EABM/Chapters/Distributions.html#distributions-in-arviz)
:::
"""
from arviz_base import load_arviz_data
import arviz_plots as azp
azp.style.use("arviz-variat")
data = load_arviz_data("centered_eight")
pc = azp.plot_dist(
data,
kind="kde",
var_names=["mu"],
sample_dims=["draw"],
backend="none" # change to preferred backend
)
pc.add_title("KDE of μ by Chain (Centered Eight)")
pc.show()