arviz 0.17.0__py3-none-any.whl → 0.18.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- arviz/__init__.py +3 -2
- arviz/data/__init__.py +5 -2
- arviz/data/base.py +102 -11
- arviz/data/converters.py +5 -0
- arviz/data/datasets.py +1 -0
- arviz/data/example_data/data_remote.json +10 -3
- arviz/data/inference_data.py +26 -25
- arviz/data/io_cmdstan.py +1 -3
- arviz/data/io_datatree.py +1 -0
- arviz/data/io_dict.py +5 -3
- arviz/data/io_emcee.py +1 -0
- arviz/data/io_numpyro.py +1 -0
- arviz/data/io_pyjags.py +1 -0
- arviz/data/io_pyro.py +1 -0
- arviz/data/io_pystan.py +1 -2
- arviz/data/utils.py +1 -0
- arviz/plots/__init__.py +1 -0
- arviz/plots/autocorrplot.py +1 -0
- arviz/plots/backends/bokeh/autocorrplot.py +1 -0
- arviz/plots/backends/bokeh/bpvplot.py +8 -2
- arviz/plots/backends/bokeh/compareplot.py +8 -4
- arviz/plots/backends/bokeh/densityplot.py +1 -0
- arviz/plots/backends/bokeh/distplot.py +1 -0
- arviz/plots/backends/bokeh/dotplot.py +1 -0
- arviz/plots/backends/bokeh/ecdfplot.py +1 -0
- arviz/plots/backends/bokeh/elpdplot.py +1 -0
- arviz/plots/backends/bokeh/energyplot.py +1 -0
- arviz/plots/backends/bokeh/forestplot.py +2 -4
- arviz/plots/backends/bokeh/hdiplot.py +1 -0
- arviz/plots/backends/bokeh/kdeplot.py +3 -3
- arviz/plots/backends/bokeh/khatplot.py +1 -0
- arviz/plots/backends/bokeh/lmplot.py +1 -0
- arviz/plots/backends/bokeh/loopitplot.py +1 -0
- arviz/plots/backends/bokeh/mcseplot.py +1 -0
- arviz/plots/backends/bokeh/pairplot.py +1 -0
- arviz/plots/backends/bokeh/parallelplot.py +1 -0
- arviz/plots/backends/bokeh/posteriorplot.py +1 -0
- arviz/plots/backends/bokeh/ppcplot.py +1 -0
- arviz/plots/backends/bokeh/rankplot.py +1 -0
- arviz/plots/backends/bokeh/separationplot.py +1 -0
- arviz/plots/backends/bokeh/traceplot.py +1 -0
- arviz/plots/backends/bokeh/violinplot.py +1 -0
- arviz/plots/backends/matplotlib/autocorrplot.py +1 -0
- arviz/plots/backends/matplotlib/bpvplot.py +1 -0
- arviz/plots/backends/matplotlib/compareplot.py +2 -1
- arviz/plots/backends/matplotlib/densityplot.py +1 -0
- arviz/plots/backends/matplotlib/distcomparisonplot.py +2 -3
- arviz/plots/backends/matplotlib/distplot.py +1 -0
- arviz/plots/backends/matplotlib/dotplot.py +1 -0
- arviz/plots/backends/matplotlib/ecdfplot.py +1 -0
- arviz/plots/backends/matplotlib/elpdplot.py +1 -0
- arviz/plots/backends/matplotlib/energyplot.py +1 -0
- arviz/plots/backends/matplotlib/essplot.py +6 -5
- arviz/plots/backends/matplotlib/forestplot.py +3 -4
- arviz/plots/backends/matplotlib/hdiplot.py +1 -0
- arviz/plots/backends/matplotlib/kdeplot.py +5 -3
- arviz/plots/backends/matplotlib/khatplot.py +1 -0
- arviz/plots/backends/matplotlib/lmplot.py +1 -0
- arviz/plots/backends/matplotlib/loopitplot.py +1 -0
- arviz/plots/backends/matplotlib/mcseplot.py +11 -10
- arviz/plots/backends/matplotlib/pairplot.py +2 -1
- arviz/plots/backends/matplotlib/parallelplot.py +1 -0
- arviz/plots/backends/matplotlib/posteriorplot.py +1 -0
- arviz/plots/backends/matplotlib/ppcplot.py +1 -0
- arviz/plots/backends/matplotlib/rankplot.py +1 -0
- arviz/plots/backends/matplotlib/separationplot.py +1 -0
- arviz/plots/backends/matplotlib/traceplot.py +2 -1
- arviz/plots/backends/matplotlib/tsplot.py +1 -0
- arviz/plots/backends/matplotlib/violinplot.py +2 -1
- arviz/plots/bfplot.py +7 -6
- arviz/plots/bpvplot.py +3 -2
- arviz/plots/compareplot.py +3 -2
- arviz/plots/densityplot.py +1 -0
- arviz/plots/distcomparisonplot.py +1 -0
- arviz/plots/dotplot.py +1 -0
- arviz/plots/ecdfplot.py +38 -112
- arviz/plots/elpdplot.py +2 -1
- arviz/plots/energyplot.py +1 -0
- arviz/plots/essplot.py +3 -2
- arviz/plots/forestplot.py +1 -0
- arviz/plots/hdiplot.py +1 -0
- arviz/plots/khatplot.py +1 -0
- arviz/plots/lmplot.py +1 -0
- arviz/plots/loopitplot.py +1 -0
- arviz/plots/mcseplot.py +1 -0
- arviz/plots/pairplot.py +2 -1
- arviz/plots/parallelplot.py +1 -0
- arviz/plots/plot_utils.py +1 -0
- arviz/plots/posteriorplot.py +1 -0
- arviz/plots/ppcplot.py +11 -5
- arviz/plots/rankplot.py +1 -0
- arviz/plots/separationplot.py +1 -0
- arviz/plots/traceplot.py +1 -0
- arviz/plots/tsplot.py +1 -0
- arviz/plots/violinplot.py +1 -0
- arviz/rcparams.py +1 -0
- arviz/sel_utils.py +1 -0
- arviz/static/css/style.css +2 -1
- arviz/stats/density_utils.py +4 -3
- arviz/stats/diagnostics.py +4 -4
- arviz/stats/ecdf_utils.py +166 -0
- arviz/stats/stats.py +16 -32
- arviz/stats/stats_refitting.py +1 -0
- arviz/stats/stats_utils.py +6 -2
- arviz/tests/base_tests/test_data.py +18 -4
- arviz/tests/base_tests/test_diagnostics.py +1 -0
- arviz/tests/base_tests/test_diagnostics_numba.py +1 -0
- arviz/tests/base_tests/test_labels.py +1 -0
- arviz/tests/base_tests/test_plots_matplotlib.py +6 -5
- arviz/tests/base_tests/test_stats.py +4 -4
- arviz/tests/base_tests/test_stats_ecdf_utils.py +153 -0
- arviz/tests/base_tests/test_stats_utils.py +4 -3
- arviz/tests/base_tests/test_utils.py +3 -2
- arviz/tests/external_tests/test_data_numpyro.py +3 -3
- arviz/tests/external_tests/test_data_pyro.py +3 -3
- arviz/tests/helpers.py +1 -1
- arviz/wrappers/__init__.py +1 -0
- {arviz-0.17.0.dist-info → arviz-0.18.0.dist-info}/METADATA +10 -9
- arviz-0.18.0.dist-info/RECORD +182 -0
- {arviz-0.17.0.dist-info → arviz-0.18.0.dist-info}/WHEEL +1 -1
- arviz-0.17.0.dist-info/RECORD +0 -180
- {arviz-0.17.0.dist-info → arviz-0.18.0.dist-info}/LICENSE +0 -0
- {arviz-0.17.0.dist-info → arviz-0.18.0.dist-info}/top_level.txt +0 -0
|
@@ -15,7 +15,6 @@ from ....rcparams import rcParams
|
|
|
15
15
|
from ....stats import hdi
|
|
16
16
|
from ....stats.density_utils import get_bins, histogram, kde
|
|
17
17
|
from ....stats.diagnostics import _ess, _rhat
|
|
18
|
-
from ....utils import conditional_jit
|
|
19
18
|
from ...plot_utils import _scale_fig_size
|
|
20
19
|
from .. import show_layout
|
|
21
20
|
from . import backend_kwarg_defaults
|
|
@@ -277,7 +276,6 @@ class PlotHandler:
|
|
|
277
276
|
"""Collect labels and ticks from plotters."""
|
|
278
277
|
val = self.plotters.values()
|
|
279
278
|
|
|
280
|
-
@conditional_jit(forceobj=True, nopython=False)
|
|
281
279
|
def label_idxs():
|
|
282
280
|
labels, idxs = [], []
|
|
283
281
|
for plotter in val:
|
|
@@ -640,7 +638,7 @@ class VarHandler:
|
|
|
640
638
|
grouped_data = [[(0, datum)] for datum in self.data]
|
|
641
639
|
skip_dims = self.combine_dims.union({"chain"})
|
|
642
640
|
else:
|
|
643
|
-
grouped_data = [datum.groupby("chain") for datum in self.data]
|
|
641
|
+
grouped_data = [datum.groupby("chain", squeeze=False) for datum in self.data]
|
|
644
642
|
skip_dims = self.combine_dims
|
|
645
643
|
|
|
646
644
|
label_dict = OrderedDict()
|
|
@@ -648,7 +646,7 @@ class VarHandler:
|
|
|
648
646
|
for name, grouped_datum in zip(self.model_names, grouped_data):
|
|
649
647
|
for _, sub_data in grouped_datum:
|
|
650
648
|
datum_iter = xarray_var_iter(
|
|
651
|
-
sub_data,
|
|
649
|
+
sub_data.squeeze(),
|
|
652
650
|
var_names=[self.var_name],
|
|
653
651
|
skip_dims=skip_dims,
|
|
654
652
|
reverse_selections=True,
|
|
@@ -6,7 +6,7 @@ from numbers import Integral
|
|
|
6
6
|
import numpy as np
|
|
7
7
|
from bokeh.models import ColumnDataSource
|
|
8
8
|
from bokeh.models.glyphs import Scatter
|
|
9
|
-
from matplotlib
|
|
9
|
+
from matplotlib import colormaps
|
|
10
10
|
from matplotlib.colors import rgb2hex
|
|
11
11
|
from matplotlib.pyplot import rcParams as mpl_rcParams
|
|
12
12
|
|
|
@@ -188,7 +188,7 @@ def plot_kde(
|
|
|
188
188
|
|
|
189
189
|
cmap = contourf_kwargs.pop("cmap", "viridis")
|
|
190
190
|
if isinstance(cmap, str):
|
|
191
|
-
cmap =
|
|
191
|
+
cmap = colormaps[cmap]
|
|
192
192
|
if isinstance(cmap, Callable):
|
|
193
193
|
colors = [rgb2hex(item) for item in cmap(np.linspace(0, 1, len(levels_scaled) + 1))]
|
|
194
194
|
else:
|
|
@@ -225,7 +225,7 @@ def plot_kde(
|
|
|
225
225
|
else:
|
|
226
226
|
cmap = pcolormesh_kwargs.pop("cmap", "viridis")
|
|
227
227
|
if isinstance(cmap, str):
|
|
228
|
-
cmap =
|
|
228
|
+
cmap = colormaps[cmap]
|
|
229
229
|
if isinstance(cmap, Callable):
|
|
230
230
|
colors = [rgb2hex(item) for item in cmap(np.linspace(0, 1, 256))]
|
|
231
231
|
else:
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"""Matplotlib Compareplot."""
|
|
2
|
+
|
|
2
3
|
import matplotlib.pyplot as plt
|
|
3
4
|
|
|
4
5
|
from ...plot_utils import _scale_fig_size
|
|
@@ -84,7 +85,7 @@ def plot_compare(
|
|
|
84
85
|
else:
|
|
85
86
|
ax.set_yticks(yticks_pos[::2])
|
|
86
87
|
|
|
87
|
-
scale = comp_df["scale"][0]
|
|
88
|
+
scale = comp_df["scale"].iloc[0]
|
|
88
89
|
|
|
89
90
|
if insample_dev:
|
|
90
91
|
p_ic = comp_df[f"p_{information_criterion.split('_')[1]}"]
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"""Matplotlib Density Comparison plot."""
|
|
2
|
+
|
|
2
3
|
import matplotlib.pyplot as plt
|
|
3
4
|
import numpy as np
|
|
4
5
|
|
|
@@ -88,9 +89,7 @@ def plot_dist_comparison(
|
|
|
88
89
|
kwargs = (
|
|
89
90
|
prior_kwargs
|
|
90
91
|
if group.startswith("prior")
|
|
91
|
-
else posterior_kwargs
|
|
92
|
-
if group.startswith("posterior")
|
|
93
|
-
else observed_kwargs
|
|
92
|
+
else posterior_kwargs if group.startswith("posterior") else observed_kwargs
|
|
94
93
|
)
|
|
95
94
|
for idx2, (
|
|
96
95
|
var_name,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"""Matplotlib energyplot."""
|
|
2
|
+
|
|
2
3
|
import matplotlib.pyplot as plt
|
|
3
4
|
import numpy as np
|
|
4
5
|
from scipy.stats import rankdata
|
|
@@ -127,11 +128,11 @@ def plot_ess(
|
|
|
127
128
|
ax_.annotate(
|
|
128
129
|
"mean",
|
|
129
130
|
(text_x, mean_ess_i),
|
|
130
|
-
va=
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
131
|
+
va=(
|
|
132
|
+
text_va
|
|
133
|
+
if text_va is not None
|
|
134
|
+
else "bottom" if mean_ess_i >= sd_ess_i else "top"
|
|
135
|
+
),
|
|
135
136
|
**text_kwargs,
|
|
136
137
|
)
|
|
137
138
|
ax_.axhline(sd_ess_i, **extra_kwargs)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"""Matplotlib forestplot."""
|
|
2
|
+
|
|
2
3
|
from collections import OrderedDict, defaultdict
|
|
3
4
|
from itertools import tee
|
|
4
5
|
|
|
@@ -11,7 +12,6 @@ from ....stats import hdi
|
|
|
11
12
|
from ....stats.density_utils import get_bins, histogram, kde
|
|
12
13
|
from ....stats.diagnostics import _ess, _rhat
|
|
13
14
|
from ....sel_utils import xarray_var_iter
|
|
14
|
-
from ....utils import conditional_jit
|
|
15
15
|
from ...plot_utils import _scale_fig_size
|
|
16
16
|
from . import backend_kwarg_defaults, backend_show
|
|
17
17
|
|
|
@@ -236,7 +236,6 @@ class PlotHandler:
|
|
|
236
236
|
"""Collect labels and ticks from plotters."""
|
|
237
237
|
val = self.plotters.values()
|
|
238
238
|
|
|
239
|
-
@conditional_jit(forceobj=True, nopython=False)
|
|
240
239
|
def label_idxs():
|
|
241
240
|
labels, idxs = [], []
|
|
242
241
|
for plotter in val:
|
|
@@ -536,7 +535,7 @@ class VarHandler:
|
|
|
536
535
|
grouped_data = [[(0, datum)] for datum in self.data]
|
|
537
536
|
skip_dims = self.combine_dims.union({"chain"})
|
|
538
537
|
else:
|
|
539
|
-
grouped_data = [datum.groupby("chain") for datum in self.data]
|
|
538
|
+
grouped_data = [datum.groupby("chain", squeeze=False) for datum in self.data]
|
|
540
539
|
skip_dims = self.combine_dims
|
|
541
540
|
|
|
542
541
|
label_dict = OrderedDict()
|
|
@@ -544,7 +543,7 @@ class VarHandler:
|
|
|
544
543
|
for name, grouped_datum in zip(self.model_names, grouped_data):
|
|
545
544
|
for _, sub_data in grouped_datum:
|
|
546
545
|
datum_iter = xarray_var_iter(
|
|
547
|
-
sub_data,
|
|
546
|
+
sub_data.squeeze(),
|
|
548
547
|
var_names=[self.var_name],
|
|
549
548
|
skip_dims=skip_dims,
|
|
550
549
|
reverse_selections=True,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"""Matplotlib kdeplot."""
|
|
2
|
+
|
|
2
3
|
import numpy as np
|
|
3
4
|
from matplotlib import pyplot as plt
|
|
4
5
|
from matplotlib import _pylab_helpers
|
|
@@ -162,10 +163,11 @@ def plot_kde(
|
|
|
162
163
|
ax.grid(False)
|
|
163
164
|
if contour:
|
|
164
165
|
qcfs = ax.contourf(x_x, y_y, density, antialiased=True, **contourf_kwargs)
|
|
165
|
-
|
|
166
|
+
ax.contour(x_x, y_y, density, **contour_kwargs)
|
|
166
167
|
if not fill_last:
|
|
167
|
-
qcfs.
|
|
168
|
-
|
|
168
|
+
alpha = np.ones(len(qcfs.allsegs), dtype=float)
|
|
169
|
+
alpha[0] = 0
|
|
170
|
+
qcfs.set_alpha(alpha)
|
|
169
171
|
else:
|
|
170
172
|
ax.pcolormesh(x_x, y_y, density, **pcolormesh_kwargs)
|
|
171
173
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"""Matplotlib mcseplot."""
|
|
2
|
+
|
|
2
3
|
import matplotlib.pyplot as plt
|
|
3
4
|
import numpy as np
|
|
4
5
|
from scipy.stats import rankdata
|
|
@@ -94,22 +95,22 @@ def plot_mcse(
|
|
|
94
95
|
ax_.annotate(
|
|
95
96
|
"mean",
|
|
96
97
|
(text_x, mean_mcse_i),
|
|
97
|
-
va=
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
va=(
|
|
99
|
+
text_va
|
|
100
|
+
if text_va is not None
|
|
101
|
+
else "bottom" if mean_mcse_i > sd_mcse_i else "top"
|
|
102
|
+
),
|
|
102
103
|
**text_kwargs,
|
|
103
104
|
)
|
|
104
105
|
ax_.axhline(sd_mcse_i, **extra_kwargs)
|
|
105
106
|
ax_.annotate(
|
|
106
107
|
"sd",
|
|
107
108
|
(text_x, sd_mcse_i),
|
|
108
|
-
va=
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
109
|
+
va=(
|
|
110
|
+
text_va
|
|
111
|
+
if text_va is not None
|
|
112
|
+
else "bottom" if sd_mcse_i >= mean_mcse_i else "top"
|
|
113
|
+
),
|
|
113
114
|
**text_kwargs,
|
|
114
115
|
)
|
|
115
116
|
if rug:
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"""Matplotlib pairplot."""
|
|
2
|
+
|
|
2
3
|
import warnings
|
|
3
4
|
from copy import deepcopy
|
|
4
5
|
|
|
@@ -333,7 +334,7 @@ def plot_pair(
|
|
|
333
334
|
if reference_values:
|
|
334
335
|
x_name = flat_var_names[i]
|
|
335
336
|
y_name = flat_var_names[j + not_marginals]
|
|
336
|
-
if x_name and y_name not in difference:
|
|
337
|
+
if (x_name not in difference) and (y_name not in difference):
|
|
337
338
|
ax[j, i].plot(
|
|
338
339
|
reference_values_copy[x_name],
|
|
339
340
|
reference_values_copy[y_name],
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"""Matplotlib traceplot."""
|
|
2
|
+
|
|
2
3
|
import warnings
|
|
3
4
|
from itertools import cycle
|
|
4
5
|
|
|
@@ -430,7 +431,7 @@ def plot_trace(
|
|
|
430
431
|
Line2D(
|
|
431
432
|
[], [], label=chain_id, **dealiase_sel_kwargs(legend_kwargs, chain_prop, chain_id)
|
|
432
433
|
)
|
|
433
|
-
for chain_id in range(data.
|
|
434
|
+
for chain_id in range(data.sizes["chain"])
|
|
434
435
|
]
|
|
435
436
|
if combined:
|
|
436
437
|
handles.insert(
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"""Matplotlib Violinplot."""
|
|
2
|
+
|
|
2
3
|
import matplotlib.pyplot as plt
|
|
3
4
|
import numpy as np
|
|
4
5
|
|
|
@@ -60,7 +61,7 @@ def plot_violin(
|
|
|
60
61
|
cols,
|
|
61
62
|
backend_kwargs=backend_kwargs,
|
|
62
63
|
)
|
|
63
|
-
fig.
|
|
64
|
+
fig.set_layout_engine("none")
|
|
64
65
|
fig.subplots_adjust(wspace=0)
|
|
65
66
|
|
|
66
67
|
ax = np.atleast_1d(ax)
|
arviz/plots/bfplot.py
CHANGED
|
@@ -38,7 +38,7 @@ def plot_bf(
|
|
|
38
38
|
algorithm presented in [1]_.
|
|
39
39
|
|
|
40
40
|
Parameters
|
|
41
|
-
|
|
41
|
+
----------
|
|
42
42
|
idata : InferenceData
|
|
43
43
|
Any object that can be converted to an :class:`arviz.InferenceData` object
|
|
44
44
|
Refer to documentation of :func:`arviz.convert_to_dataset` for details.
|
|
@@ -52,16 +52,16 @@ def plot_bf(
|
|
|
52
52
|
Tuple of valid Matplotlib colors. First element for the prior, second for the posterior.
|
|
53
53
|
figsize : (float, float), optional
|
|
54
54
|
Figure size. If `None` it will be defined automatically.
|
|
55
|
-
textsize: float, optional
|
|
55
|
+
textsize : float, optional
|
|
56
56
|
Text size scaling factor for labels, titles and lines. If `None` it will be auto
|
|
57
57
|
scaled based on `figsize`.
|
|
58
|
-
plot_kwargs :
|
|
58
|
+
plot_kwargs : dict, optional
|
|
59
59
|
Additional keywords passed to :func:`matplotlib.pyplot.plot`.
|
|
60
|
-
hist_kwargs :
|
|
60
|
+
hist_kwargs : dict, optional
|
|
61
61
|
Additional keywords passed to :func:`arviz.plot_dist`. Only works for discrete variables.
|
|
62
62
|
ax : axes, optional
|
|
63
63
|
:class:`matplotlib.axes.Axes` or :class:`bokeh.plotting.Figure`.
|
|
64
|
-
backend :{"matplotlib", "bokeh"}, default "matplotlib"
|
|
64
|
+
backend : {"matplotlib", "bokeh"}, default "matplotlib"
|
|
65
65
|
Select plotting backend.
|
|
66
66
|
backend_kwargs : dict, optional
|
|
67
67
|
These are kwargs specific to the backend being used, passed to
|
|
@@ -78,7 +78,7 @@ def plot_bf(
|
|
|
78
78
|
References
|
|
79
79
|
----------
|
|
80
80
|
.. [1] Heck, D., 2019. A caveat on the Savage-Dickey density ratio:
|
|
81
|
-
|
|
81
|
+
The case of computing Bayes factors for regression parameters.
|
|
82
82
|
|
|
83
83
|
Examples
|
|
84
84
|
--------
|
|
@@ -92,6 +92,7 @@ def plot_bf(
|
|
|
92
92
|
>>> idata = az.from_dict(posterior={"a":np.random.normal(1, 0.5, 5000)},
|
|
93
93
|
... prior={"a":np.random.normal(0, 1, 5000)})
|
|
94
94
|
>>> az.plot_bf(idata, var_name="a", ref_val=0)
|
|
95
|
+
|
|
95
96
|
"""
|
|
96
97
|
posterior = extract(idata, var_names=var_name).values
|
|
97
98
|
|
arviz/plots/bpvplot.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"""Bayesian p-value Posterior/Prior predictive plot."""
|
|
2
|
+
|
|
2
3
|
import numpy as np
|
|
3
4
|
|
|
4
5
|
from ..labels import BaseLabeller
|
|
@@ -230,11 +231,11 @@ def plot_bpv(
|
|
|
230
231
|
|
|
231
232
|
if flatten_pp is None:
|
|
232
233
|
if flatten is None:
|
|
233
|
-
flatten_pp = list(predictive_dataset.dims
|
|
234
|
+
flatten_pp = list(predictive_dataset.dims)
|
|
234
235
|
else:
|
|
235
236
|
flatten_pp = flatten
|
|
236
237
|
if flatten is None:
|
|
237
|
-
flatten = list(observed.dims
|
|
238
|
+
flatten = list(observed.dims)
|
|
238
239
|
|
|
239
240
|
if coords is None:
|
|
240
241
|
coords = {}
|
arviz/plots/compareplot.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"""Summary plot for model comparison."""
|
|
2
|
+
|
|
2
3
|
import numpy as np
|
|
3
4
|
|
|
4
5
|
from ..labels import BaseLabeller
|
|
@@ -90,10 +91,10 @@ def plot_compare(
|
|
|
90
91
|
References
|
|
91
92
|
----------
|
|
92
93
|
.. [1] Vehtari et al. (2016). Practical Bayesian model evaluation using leave-one-out
|
|
93
|
-
|
|
94
|
+
cross-validation and WAIC https://arxiv.org/abs/1507.04544
|
|
94
95
|
|
|
95
96
|
.. [2] McElreath R. (2022). Statistical Rethinking A Bayesian Course with Examples in
|
|
96
|
-
|
|
97
|
+
R and Stan, Second edition, CRC Press.
|
|
97
98
|
|
|
98
99
|
Examples
|
|
99
100
|
--------
|
arviz/plots/densityplot.py
CHANGED