arviz 0.23.3__py3-none-any.whl → 1.0.0rc0__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 +52 -367
- arviz-1.0.0rc0.dist-info/METADATA +182 -0
- arviz-1.0.0rc0.dist-info/RECORD +5 -0
- {arviz-0.23.3.dist-info → arviz-1.0.0rc0.dist-info}/WHEEL +1 -2
- {arviz-0.23.3.dist-info → arviz-1.0.0rc0.dist-info}/licenses/LICENSE +0 -1
- arviz/data/__init__.py +0 -55
- arviz/data/base.py +0 -596
- arviz/data/converters.py +0 -203
- arviz/data/datasets.py +0 -161
- arviz/data/example_data/code/radon/radon.json +0 -326
- arviz/data/example_data/data/centered_eight.nc +0 -0
- arviz/data/example_data/data/non_centered_eight.nc +0 -0
- arviz/data/example_data/data_local.json +0 -12
- arviz/data/example_data/data_remote.json +0 -58
- arviz/data/inference_data.py +0 -2386
- arviz/data/io_beanmachine.py +0 -112
- arviz/data/io_cmdstan.py +0 -1036
- arviz/data/io_cmdstanpy.py +0 -1233
- arviz/data/io_datatree.py +0 -23
- arviz/data/io_dict.py +0 -462
- arviz/data/io_emcee.py +0 -317
- arviz/data/io_json.py +0 -54
- arviz/data/io_netcdf.py +0 -68
- arviz/data/io_numpyro.py +0 -497
- arviz/data/io_pyjags.py +0 -378
- arviz/data/io_pyro.py +0 -333
- arviz/data/io_pystan.py +0 -1095
- arviz/data/io_zarr.py +0 -46
- arviz/data/utils.py +0 -139
- arviz/labels.py +0 -210
- arviz/plots/__init__.py +0 -61
- arviz/plots/autocorrplot.py +0 -171
- arviz/plots/backends/__init__.py +0 -223
- arviz/plots/backends/bokeh/__init__.py +0 -166
- arviz/plots/backends/bokeh/autocorrplot.py +0 -101
- arviz/plots/backends/bokeh/bfplot.py +0 -23
- arviz/plots/backends/bokeh/bpvplot.py +0 -193
- arviz/plots/backends/bokeh/compareplot.py +0 -167
- arviz/plots/backends/bokeh/densityplot.py +0 -239
- arviz/plots/backends/bokeh/distcomparisonplot.py +0 -23
- arviz/plots/backends/bokeh/distplot.py +0 -183
- arviz/plots/backends/bokeh/dotplot.py +0 -113
- arviz/plots/backends/bokeh/ecdfplot.py +0 -73
- arviz/plots/backends/bokeh/elpdplot.py +0 -203
- arviz/plots/backends/bokeh/energyplot.py +0 -155
- arviz/plots/backends/bokeh/essplot.py +0 -176
- arviz/plots/backends/bokeh/forestplot.py +0 -772
- arviz/plots/backends/bokeh/hdiplot.py +0 -54
- arviz/plots/backends/bokeh/kdeplot.py +0 -268
- arviz/plots/backends/bokeh/khatplot.py +0 -163
- arviz/plots/backends/bokeh/lmplot.py +0 -185
- arviz/plots/backends/bokeh/loopitplot.py +0 -211
- arviz/plots/backends/bokeh/mcseplot.py +0 -184
- arviz/plots/backends/bokeh/pairplot.py +0 -328
- arviz/plots/backends/bokeh/parallelplot.py +0 -81
- arviz/plots/backends/bokeh/posteriorplot.py +0 -324
- arviz/plots/backends/bokeh/ppcplot.py +0 -379
- arviz/plots/backends/bokeh/rankplot.py +0 -149
- arviz/plots/backends/bokeh/separationplot.py +0 -107
- arviz/plots/backends/bokeh/traceplot.py +0 -436
- arviz/plots/backends/bokeh/violinplot.py +0 -164
- arviz/plots/backends/matplotlib/__init__.py +0 -124
- arviz/plots/backends/matplotlib/autocorrplot.py +0 -72
- arviz/plots/backends/matplotlib/bfplot.py +0 -78
- arviz/plots/backends/matplotlib/bpvplot.py +0 -177
- arviz/plots/backends/matplotlib/compareplot.py +0 -135
- arviz/plots/backends/matplotlib/densityplot.py +0 -194
- arviz/plots/backends/matplotlib/distcomparisonplot.py +0 -119
- arviz/plots/backends/matplotlib/distplot.py +0 -178
- arviz/plots/backends/matplotlib/dotplot.py +0 -116
- arviz/plots/backends/matplotlib/ecdfplot.py +0 -70
- arviz/plots/backends/matplotlib/elpdplot.py +0 -189
- arviz/plots/backends/matplotlib/energyplot.py +0 -113
- arviz/plots/backends/matplotlib/essplot.py +0 -180
- arviz/plots/backends/matplotlib/forestplot.py +0 -656
- arviz/plots/backends/matplotlib/hdiplot.py +0 -48
- arviz/plots/backends/matplotlib/kdeplot.py +0 -177
- arviz/plots/backends/matplotlib/khatplot.py +0 -241
- arviz/plots/backends/matplotlib/lmplot.py +0 -149
- arviz/plots/backends/matplotlib/loopitplot.py +0 -144
- arviz/plots/backends/matplotlib/mcseplot.py +0 -161
- arviz/plots/backends/matplotlib/pairplot.py +0 -355
- arviz/plots/backends/matplotlib/parallelplot.py +0 -58
- arviz/plots/backends/matplotlib/posteriorplot.py +0 -348
- arviz/plots/backends/matplotlib/ppcplot.py +0 -478
- arviz/plots/backends/matplotlib/rankplot.py +0 -119
- arviz/plots/backends/matplotlib/separationplot.py +0 -97
- arviz/plots/backends/matplotlib/traceplot.py +0 -526
- arviz/plots/backends/matplotlib/tsplot.py +0 -121
- arviz/plots/backends/matplotlib/violinplot.py +0 -148
- arviz/plots/bfplot.py +0 -128
- arviz/plots/bpvplot.py +0 -308
- arviz/plots/compareplot.py +0 -177
- arviz/plots/densityplot.py +0 -284
- arviz/plots/distcomparisonplot.py +0 -197
- arviz/plots/distplot.py +0 -233
- arviz/plots/dotplot.py +0 -233
- arviz/plots/ecdfplot.py +0 -372
- arviz/plots/elpdplot.py +0 -174
- arviz/plots/energyplot.py +0 -147
- arviz/plots/essplot.py +0 -319
- arviz/plots/forestplot.py +0 -304
- arviz/plots/hdiplot.py +0 -211
- arviz/plots/kdeplot.py +0 -357
- arviz/plots/khatplot.py +0 -236
- arviz/plots/lmplot.py +0 -380
- arviz/plots/loopitplot.py +0 -224
- arviz/plots/mcseplot.py +0 -194
- arviz/plots/pairplot.py +0 -281
- arviz/plots/parallelplot.py +0 -204
- arviz/plots/plot_utils.py +0 -599
- arviz/plots/posteriorplot.py +0 -298
- arviz/plots/ppcplot.py +0 -369
- arviz/plots/rankplot.py +0 -232
- arviz/plots/separationplot.py +0 -167
- arviz/plots/styles/arviz-bluish.mplstyle +0 -1
- arviz/plots/styles/arviz-brownish.mplstyle +0 -1
- arviz/plots/styles/arviz-colors.mplstyle +0 -2
- arviz/plots/styles/arviz-cyanish.mplstyle +0 -1
- arviz/plots/styles/arviz-darkgrid.mplstyle +0 -40
- arviz/plots/styles/arviz-doc.mplstyle +0 -88
- arviz/plots/styles/arviz-docgrid.mplstyle +0 -88
- arviz/plots/styles/arviz-grayscale.mplstyle +0 -41
- arviz/plots/styles/arviz-greenish.mplstyle +0 -1
- arviz/plots/styles/arviz-orangish.mplstyle +0 -1
- arviz/plots/styles/arviz-plasmish.mplstyle +0 -1
- arviz/plots/styles/arviz-purplish.mplstyle +0 -1
- arviz/plots/styles/arviz-redish.mplstyle +0 -1
- arviz/plots/styles/arviz-royish.mplstyle +0 -1
- arviz/plots/styles/arviz-viridish.mplstyle +0 -1
- arviz/plots/styles/arviz-white.mplstyle +0 -40
- arviz/plots/styles/arviz-whitegrid.mplstyle +0 -40
- arviz/plots/traceplot.py +0 -273
- arviz/plots/tsplot.py +0 -440
- arviz/plots/violinplot.py +0 -192
- arviz/preview.py +0 -58
- arviz/py.typed +0 -0
- arviz/rcparams.py +0 -606
- arviz/sel_utils.py +0 -223
- arviz/static/css/style.css +0 -340
- arviz/static/html/icons-svg-inline.html +0 -15
- arviz/stats/__init__.py +0 -37
- arviz/stats/density_utils.py +0 -1013
- arviz/stats/diagnostics.py +0 -1013
- arviz/stats/ecdf_utils.py +0 -324
- arviz/stats/stats.py +0 -2422
- arviz/stats/stats_refitting.py +0 -119
- arviz/stats/stats_utils.py +0 -609
- arviz/tests/__init__.py +0 -1
- arviz/tests/base_tests/__init__.py +0 -1
- arviz/tests/base_tests/test_data.py +0 -1679
- arviz/tests/base_tests/test_data_zarr.py +0 -143
- arviz/tests/base_tests/test_diagnostics.py +0 -511
- arviz/tests/base_tests/test_diagnostics_numba.py +0 -87
- arviz/tests/base_tests/test_helpers.py +0 -18
- arviz/tests/base_tests/test_labels.py +0 -69
- arviz/tests/base_tests/test_plot_utils.py +0 -342
- arviz/tests/base_tests/test_plots_bokeh.py +0 -1288
- arviz/tests/base_tests/test_plots_matplotlib.py +0 -2197
- arviz/tests/base_tests/test_rcparams.py +0 -317
- arviz/tests/base_tests/test_stats.py +0 -925
- arviz/tests/base_tests/test_stats_ecdf_utils.py +0 -166
- arviz/tests/base_tests/test_stats_numba.py +0 -45
- arviz/tests/base_tests/test_stats_utils.py +0 -384
- arviz/tests/base_tests/test_utils.py +0 -376
- arviz/tests/base_tests/test_utils_numba.py +0 -87
- arviz/tests/conftest.py +0 -46
- arviz/tests/external_tests/__init__.py +0 -1
- arviz/tests/external_tests/test_data_beanmachine.py +0 -78
- arviz/tests/external_tests/test_data_cmdstan.py +0 -398
- arviz/tests/external_tests/test_data_cmdstanpy.py +0 -496
- arviz/tests/external_tests/test_data_emcee.py +0 -166
- arviz/tests/external_tests/test_data_numpyro.py +0 -434
- arviz/tests/external_tests/test_data_pyjags.py +0 -119
- arviz/tests/external_tests/test_data_pyro.py +0 -260
- arviz/tests/external_tests/test_data_pystan.py +0 -307
- arviz/tests/helpers.py +0 -677
- arviz/utils.py +0 -773
- arviz/wrappers/__init__.py +0 -13
- arviz/wrappers/base.py +0 -236
- arviz/wrappers/wrap_pymc.py +0 -36
- arviz/wrappers/wrap_stan.py +0 -148
- arviz-0.23.3.dist-info/METADATA +0 -264
- arviz-0.23.3.dist-info/RECORD +0 -183
- arviz-0.23.3.dist-info/top_level.txt +0 -1
arviz/data/io_beanmachine.py
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
"""beanmachine-specific conversion code."""
|
|
2
|
-
|
|
3
|
-
from .inference_data import InferenceData
|
|
4
|
-
from .base import dict_to_dataset, requires
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class BMConverter:
|
|
8
|
-
"""Encapsulate Bean Machine specific logic."""
|
|
9
|
-
|
|
10
|
-
def __init__(
|
|
11
|
-
self,
|
|
12
|
-
*,
|
|
13
|
-
sampler=None,
|
|
14
|
-
coords=None,
|
|
15
|
-
dims=None,
|
|
16
|
-
) -> None:
|
|
17
|
-
self.sampler = sampler
|
|
18
|
-
self.coords = coords
|
|
19
|
-
self.dims = dims
|
|
20
|
-
|
|
21
|
-
import beanmachine.ppl as bm # pylint: disable=import-error
|
|
22
|
-
|
|
23
|
-
self.beanm = bm
|
|
24
|
-
|
|
25
|
-
if "posterior" in self.sampler.namespaces:
|
|
26
|
-
self.posterior = self.sampler.namespaces["posterior"].samples
|
|
27
|
-
else:
|
|
28
|
-
self.posterior = None
|
|
29
|
-
|
|
30
|
-
if "posterior_predictive" in self.sampler.namespaces:
|
|
31
|
-
self.posterior_predictive = self.sampler.namespaces["posterior_predictive"].samples
|
|
32
|
-
else:
|
|
33
|
-
self.posterior_predictive = None
|
|
34
|
-
|
|
35
|
-
if self.sampler.log_likelihoods is not None:
|
|
36
|
-
self.log_likelihoods = self.sampler.log_likelihoods
|
|
37
|
-
else:
|
|
38
|
-
self.log_likelihoods = None
|
|
39
|
-
|
|
40
|
-
if self.sampler.observations is not None:
|
|
41
|
-
self.observations = self.sampler.observations
|
|
42
|
-
else:
|
|
43
|
-
self.observations = None
|
|
44
|
-
|
|
45
|
-
@requires("posterior")
|
|
46
|
-
def posterior_to_xarray(self):
|
|
47
|
-
"""Convert the posterior to an xarray dataset."""
|
|
48
|
-
data = {k: v.detach().cpu().numpy() for k, v in self.posterior.items()}
|
|
49
|
-
return dict_to_dataset(data, library=self.beanm, coords=self.coords, dims=self.dims)
|
|
50
|
-
|
|
51
|
-
@requires("posterior_predictive")
|
|
52
|
-
def posterior_predictive_to_xarray(self):
|
|
53
|
-
"""Convert posterior_predictive samples to xarray."""
|
|
54
|
-
data = {k: v.detach().cpu().numpy() for k, v in self.posterior_predictive.items()}
|
|
55
|
-
return dict_to_dataset(data, library=self.beanm, coords=self.coords, dims=self.dims)
|
|
56
|
-
|
|
57
|
-
@requires("log_likelihoods")
|
|
58
|
-
def log_likelihood_to_xarray(self):
|
|
59
|
-
data = {k: v.detach().cpu().numpy() for k, v in self.log_likelihoods.items()}
|
|
60
|
-
return dict_to_dataset(data, library=self.beanm, coords=self.coords, dims=self.dims)
|
|
61
|
-
|
|
62
|
-
@requires("observations")
|
|
63
|
-
def observed_data_to_xarray(self):
|
|
64
|
-
"""Convert observed data to xarray."""
|
|
65
|
-
data = {k: v.detach().cpu().numpy() for k, v in self.observations.items()}
|
|
66
|
-
return dict_to_dataset(
|
|
67
|
-
data, library=self.beanm, coords=self.coords, dims=self.dims, default_dims=[]
|
|
68
|
-
)
|
|
69
|
-
|
|
70
|
-
def to_inference_data(self):
|
|
71
|
-
"""Convert all available data to an InferenceData object."""
|
|
72
|
-
return InferenceData(
|
|
73
|
-
**{
|
|
74
|
-
"posterior": self.posterior_to_xarray(),
|
|
75
|
-
"posterior_predictive": self.posterior_predictive_to_xarray(),
|
|
76
|
-
"log_likelihood": self.log_likelihood_to_xarray(),
|
|
77
|
-
"observed_data": self.observed_data_to_xarray(),
|
|
78
|
-
}
|
|
79
|
-
)
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
def from_beanmachine(
|
|
83
|
-
sampler=None,
|
|
84
|
-
*,
|
|
85
|
-
coords=None,
|
|
86
|
-
dims=None,
|
|
87
|
-
):
|
|
88
|
-
"""Convert Bean Machine MonteCarloSamples object into an InferenceData object.
|
|
89
|
-
|
|
90
|
-
For a usage example read the
|
|
91
|
-
:ref:`Creating InferenceData section on from_beanmachine <creating_InferenceData>`
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
Parameters
|
|
95
|
-
----------
|
|
96
|
-
sampler : bm.MonteCarloSamples
|
|
97
|
-
Fitted MonteCarloSamples object from Bean Machine
|
|
98
|
-
coords : dict of {str : array-like}
|
|
99
|
-
Map of dimensions to coordinates
|
|
100
|
-
dims : dict of {str : list of str}
|
|
101
|
-
Map variable names to their coordinates
|
|
102
|
-
|
|
103
|
-
Warnings
|
|
104
|
-
--------
|
|
105
|
-
`beanmachine` is no longer under active development, and therefore, it
|
|
106
|
-
is not possible to test this converter in ArviZ's CI.
|
|
107
|
-
"""
|
|
108
|
-
return BMConverter(
|
|
109
|
-
sampler=sampler,
|
|
110
|
-
coords=coords,
|
|
111
|
-
dims=dims,
|
|
112
|
-
).to_inference_data()
|