arviz 0.23.1__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.
Files changed (185) hide show
  1. arviz/__init__.py +52 -357
  2. arviz-1.0.0rc0.dist-info/METADATA +182 -0
  3. arviz-1.0.0rc0.dist-info/RECORD +5 -0
  4. {arviz-0.23.1.dist-info → arviz-1.0.0rc0.dist-info}/WHEEL +1 -2
  5. {arviz-0.23.1.dist-info → arviz-1.0.0rc0.dist-info}/licenses/LICENSE +0 -1
  6. arviz/data/__init__.py +0 -55
  7. arviz/data/base.py +0 -596
  8. arviz/data/converters.py +0 -203
  9. arviz/data/datasets.py +0 -161
  10. arviz/data/example_data/code/radon/radon.json +0 -326
  11. arviz/data/example_data/data/centered_eight.nc +0 -0
  12. arviz/data/example_data/data/non_centered_eight.nc +0 -0
  13. arviz/data/example_data/data_local.json +0 -12
  14. arviz/data/example_data/data_remote.json +0 -58
  15. arviz/data/inference_data.py +0 -2386
  16. arviz/data/io_beanmachine.py +0 -112
  17. arviz/data/io_cmdstan.py +0 -1036
  18. arviz/data/io_cmdstanpy.py +0 -1233
  19. arviz/data/io_datatree.py +0 -23
  20. arviz/data/io_dict.py +0 -462
  21. arviz/data/io_emcee.py +0 -317
  22. arviz/data/io_json.py +0 -54
  23. arviz/data/io_netcdf.py +0 -68
  24. arviz/data/io_numpyro.py +0 -497
  25. arviz/data/io_pyjags.py +0 -378
  26. arviz/data/io_pyro.py +0 -333
  27. arviz/data/io_pystan.py +0 -1095
  28. arviz/data/io_zarr.py +0 -46
  29. arviz/data/utils.py +0 -139
  30. arviz/labels.py +0 -210
  31. arviz/plots/__init__.py +0 -61
  32. arviz/plots/autocorrplot.py +0 -171
  33. arviz/plots/backends/__init__.py +0 -223
  34. arviz/plots/backends/bokeh/__init__.py +0 -166
  35. arviz/plots/backends/bokeh/autocorrplot.py +0 -101
  36. arviz/plots/backends/bokeh/bfplot.py +0 -23
  37. arviz/plots/backends/bokeh/bpvplot.py +0 -193
  38. arviz/plots/backends/bokeh/compareplot.py +0 -167
  39. arviz/plots/backends/bokeh/densityplot.py +0 -239
  40. arviz/plots/backends/bokeh/distcomparisonplot.py +0 -23
  41. arviz/plots/backends/bokeh/distplot.py +0 -183
  42. arviz/plots/backends/bokeh/dotplot.py +0 -113
  43. arviz/plots/backends/bokeh/ecdfplot.py +0 -73
  44. arviz/plots/backends/bokeh/elpdplot.py +0 -203
  45. arviz/plots/backends/bokeh/energyplot.py +0 -155
  46. arviz/plots/backends/bokeh/essplot.py +0 -176
  47. arviz/plots/backends/bokeh/forestplot.py +0 -772
  48. arviz/plots/backends/bokeh/hdiplot.py +0 -54
  49. arviz/plots/backends/bokeh/kdeplot.py +0 -268
  50. arviz/plots/backends/bokeh/khatplot.py +0 -163
  51. arviz/plots/backends/bokeh/lmplot.py +0 -185
  52. arviz/plots/backends/bokeh/loopitplot.py +0 -211
  53. arviz/plots/backends/bokeh/mcseplot.py +0 -184
  54. arviz/plots/backends/bokeh/pairplot.py +0 -328
  55. arviz/plots/backends/bokeh/parallelplot.py +0 -81
  56. arviz/plots/backends/bokeh/posteriorplot.py +0 -324
  57. arviz/plots/backends/bokeh/ppcplot.py +0 -379
  58. arviz/plots/backends/bokeh/rankplot.py +0 -149
  59. arviz/plots/backends/bokeh/separationplot.py +0 -107
  60. arviz/plots/backends/bokeh/traceplot.py +0 -436
  61. arviz/plots/backends/bokeh/violinplot.py +0 -164
  62. arviz/plots/backends/matplotlib/__init__.py +0 -124
  63. arviz/plots/backends/matplotlib/autocorrplot.py +0 -72
  64. arviz/plots/backends/matplotlib/bfplot.py +0 -78
  65. arviz/plots/backends/matplotlib/bpvplot.py +0 -177
  66. arviz/plots/backends/matplotlib/compareplot.py +0 -135
  67. arviz/plots/backends/matplotlib/densityplot.py +0 -194
  68. arviz/plots/backends/matplotlib/distcomparisonplot.py +0 -119
  69. arviz/plots/backends/matplotlib/distplot.py +0 -178
  70. arviz/plots/backends/matplotlib/dotplot.py +0 -116
  71. arviz/plots/backends/matplotlib/ecdfplot.py +0 -70
  72. arviz/plots/backends/matplotlib/elpdplot.py +0 -189
  73. arviz/plots/backends/matplotlib/energyplot.py +0 -113
  74. arviz/plots/backends/matplotlib/essplot.py +0 -180
  75. arviz/plots/backends/matplotlib/forestplot.py +0 -656
  76. arviz/plots/backends/matplotlib/hdiplot.py +0 -48
  77. arviz/plots/backends/matplotlib/kdeplot.py +0 -177
  78. arviz/plots/backends/matplotlib/khatplot.py +0 -241
  79. arviz/plots/backends/matplotlib/lmplot.py +0 -149
  80. arviz/plots/backends/matplotlib/loopitplot.py +0 -144
  81. arviz/plots/backends/matplotlib/mcseplot.py +0 -161
  82. arviz/plots/backends/matplotlib/pairplot.py +0 -355
  83. arviz/plots/backends/matplotlib/parallelplot.py +0 -58
  84. arviz/plots/backends/matplotlib/posteriorplot.py +0 -348
  85. arviz/plots/backends/matplotlib/ppcplot.py +0 -478
  86. arviz/plots/backends/matplotlib/rankplot.py +0 -119
  87. arviz/plots/backends/matplotlib/separationplot.py +0 -97
  88. arviz/plots/backends/matplotlib/traceplot.py +0 -526
  89. arviz/plots/backends/matplotlib/tsplot.py +0 -121
  90. arviz/plots/backends/matplotlib/violinplot.py +0 -148
  91. arviz/plots/bfplot.py +0 -128
  92. arviz/plots/bpvplot.py +0 -308
  93. arviz/plots/compareplot.py +0 -177
  94. arviz/plots/densityplot.py +0 -284
  95. arviz/plots/distcomparisonplot.py +0 -197
  96. arviz/plots/distplot.py +0 -233
  97. arviz/plots/dotplot.py +0 -233
  98. arviz/plots/ecdfplot.py +0 -372
  99. arviz/plots/elpdplot.py +0 -174
  100. arviz/plots/energyplot.py +0 -147
  101. arviz/plots/essplot.py +0 -319
  102. arviz/plots/forestplot.py +0 -304
  103. arviz/plots/hdiplot.py +0 -211
  104. arviz/plots/kdeplot.py +0 -357
  105. arviz/plots/khatplot.py +0 -236
  106. arviz/plots/lmplot.py +0 -380
  107. arviz/plots/loopitplot.py +0 -224
  108. arviz/plots/mcseplot.py +0 -194
  109. arviz/plots/pairplot.py +0 -281
  110. arviz/plots/parallelplot.py +0 -204
  111. arviz/plots/plot_utils.py +0 -599
  112. arviz/plots/posteriorplot.py +0 -298
  113. arviz/plots/ppcplot.py +0 -369
  114. arviz/plots/rankplot.py +0 -232
  115. arviz/plots/separationplot.py +0 -167
  116. arviz/plots/styles/arviz-bluish.mplstyle +0 -1
  117. arviz/plots/styles/arviz-brownish.mplstyle +0 -1
  118. arviz/plots/styles/arviz-colors.mplstyle +0 -2
  119. arviz/plots/styles/arviz-cyanish.mplstyle +0 -1
  120. arviz/plots/styles/arviz-darkgrid.mplstyle +0 -40
  121. arviz/plots/styles/arviz-doc.mplstyle +0 -88
  122. arviz/plots/styles/arviz-docgrid.mplstyle +0 -88
  123. arviz/plots/styles/arviz-grayscale.mplstyle +0 -41
  124. arviz/plots/styles/arviz-greenish.mplstyle +0 -1
  125. arviz/plots/styles/arviz-orangish.mplstyle +0 -1
  126. arviz/plots/styles/arviz-plasmish.mplstyle +0 -1
  127. arviz/plots/styles/arviz-purplish.mplstyle +0 -1
  128. arviz/plots/styles/arviz-redish.mplstyle +0 -1
  129. arviz/plots/styles/arviz-royish.mplstyle +0 -1
  130. arviz/plots/styles/arviz-viridish.mplstyle +0 -1
  131. arviz/plots/styles/arviz-white.mplstyle +0 -40
  132. arviz/plots/styles/arviz-whitegrid.mplstyle +0 -40
  133. arviz/plots/traceplot.py +0 -273
  134. arviz/plots/tsplot.py +0 -440
  135. arviz/plots/violinplot.py +0 -192
  136. arviz/preview.py +0 -58
  137. arviz/py.typed +0 -0
  138. arviz/rcparams.py +0 -606
  139. arviz/sel_utils.py +0 -223
  140. arviz/static/css/style.css +0 -340
  141. arviz/static/html/icons-svg-inline.html +0 -15
  142. arviz/stats/__init__.py +0 -37
  143. arviz/stats/density_utils.py +0 -1013
  144. arviz/stats/diagnostics.py +0 -1013
  145. arviz/stats/ecdf_utils.py +0 -324
  146. arviz/stats/stats.py +0 -2422
  147. arviz/stats/stats_refitting.py +0 -119
  148. arviz/stats/stats_utils.py +0 -609
  149. arviz/tests/__init__.py +0 -1
  150. arviz/tests/base_tests/__init__.py +0 -1
  151. arviz/tests/base_tests/test_data.py +0 -1679
  152. arviz/tests/base_tests/test_data_zarr.py +0 -143
  153. arviz/tests/base_tests/test_diagnostics.py +0 -511
  154. arviz/tests/base_tests/test_diagnostics_numba.py +0 -87
  155. arviz/tests/base_tests/test_helpers.py +0 -18
  156. arviz/tests/base_tests/test_labels.py +0 -69
  157. arviz/tests/base_tests/test_plot_utils.py +0 -342
  158. arviz/tests/base_tests/test_plots_bokeh.py +0 -1288
  159. arviz/tests/base_tests/test_plots_matplotlib.py +0 -2197
  160. arviz/tests/base_tests/test_rcparams.py +0 -317
  161. arviz/tests/base_tests/test_stats.py +0 -925
  162. arviz/tests/base_tests/test_stats_ecdf_utils.py +0 -166
  163. arviz/tests/base_tests/test_stats_numba.py +0 -45
  164. arviz/tests/base_tests/test_stats_utils.py +0 -384
  165. arviz/tests/base_tests/test_utils.py +0 -376
  166. arviz/tests/base_tests/test_utils_numba.py +0 -87
  167. arviz/tests/conftest.py +0 -46
  168. arviz/tests/external_tests/__init__.py +0 -1
  169. arviz/tests/external_tests/test_data_beanmachine.py +0 -78
  170. arviz/tests/external_tests/test_data_cmdstan.py +0 -398
  171. arviz/tests/external_tests/test_data_cmdstanpy.py +0 -496
  172. arviz/tests/external_tests/test_data_emcee.py +0 -166
  173. arviz/tests/external_tests/test_data_numpyro.py +0 -434
  174. arviz/tests/external_tests/test_data_pyjags.py +0 -119
  175. arviz/tests/external_tests/test_data_pyro.py +0 -260
  176. arviz/tests/external_tests/test_data_pystan.py +0 -307
  177. arviz/tests/helpers.py +0 -677
  178. arviz/utils.py +0 -773
  179. arviz/wrappers/__init__.py +0 -13
  180. arviz/wrappers/base.py +0 -236
  181. arviz/wrappers/wrap_pymc.py +0 -36
  182. arviz/wrappers/wrap_stan.py +0 -148
  183. arviz-0.23.1.dist-info/METADATA +0 -263
  184. arviz-0.23.1.dist-info/RECORD +0 -183
  185. arviz-0.23.1.dist-info/top_level.txt +0 -1
@@ -1,58 +0,0 @@
1
- """Matplotlib Parallel coordinates plot."""
2
-
3
- import matplotlib.pyplot as plt
4
- import numpy as np
5
-
6
- from ...plot_utils import _scale_fig_size
7
- from . import backend_kwarg_defaults, backend_show, create_axes_grid
8
-
9
-
10
- def plot_parallel(
11
- ax,
12
- colornd,
13
- colord,
14
- shadend,
15
- diverging_mask,
16
- posterior,
17
- textsize,
18
- var_names,
19
- legend,
20
- figsize,
21
- backend_kwargs,
22
- backend_config, # pylint: disable=unused-argument
23
- show,
24
- ):
25
- """Matplotlib parallel plot."""
26
- if backend_kwargs is None:
27
- backend_kwargs = {}
28
-
29
- backend_kwargs = {
30
- **backend_kwarg_defaults(),
31
- **backend_kwargs,
32
- }
33
-
34
- figsize, _, _, xt_labelsize, _, _ = _scale_fig_size(figsize, textsize, 1, 1)
35
- backend_kwargs.setdefault("figsize", figsize)
36
- backend_kwargs["squeeze"] = True
37
- if ax is None:
38
- _, ax = create_axes_grid(1, backend_kwargs=backend_kwargs)
39
-
40
- ax.plot(posterior[:, ~diverging_mask], color=colornd, alpha=shadend)
41
-
42
- if np.any(diverging_mask):
43
- ax.plot(posterior[:, diverging_mask], color=colord, lw=1)
44
-
45
- ax.tick_params(labelsize=textsize)
46
- ax.set_xticks(range(len(var_names)))
47
- ax.set_xticklabels(var_names)
48
-
49
- if legend:
50
- ax.plot([], color=colornd, label="non-divergent")
51
- if np.any(diverging_mask):
52
- ax.plot([], color=colord, label="divergent")
53
- ax.legend(fontsize=xt_labelsize)
54
-
55
- if backend_show(show):
56
- plt.show()
57
-
58
- return ax
@@ -1,348 +0,0 @@
1
- """Matplotlib Plot posterior densities."""
2
-
3
- from numbers import Number
4
-
5
- import matplotlib.pyplot as plt
6
- import numpy as np
7
-
8
- from ....stats import hdi
9
- from ....stats.density_utils import get_bins
10
- from ...kdeplot import plot_kde
11
- from ...plot_utils import (
12
- _scale_fig_size,
13
- calculate_point_estimate,
14
- format_sig_figs,
15
- round_num,
16
- vectorized_to_hex,
17
- )
18
- from . import backend_kwarg_defaults, backend_show, create_axes_grid, matplotlib_kwarg_dealiaser
19
-
20
-
21
- def plot_posterior(
22
- ax,
23
- length_plotters,
24
- rows,
25
- cols,
26
- figsize,
27
- plotters,
28
- bw,
29
- circular,
30
- bins,
31
- kind,
32
- point_estimate,
33
- round_to,
34
- hdi_prob,
35
- multimodal,
36
- skipna,
37
- textsize,
38
- ref_val,
39
- rope,
40
- ref_val_color,
41
- rope_color,
42
- labeller,
43
- kwargs,
44
- backend_kwargs,
45
- show,
46
- ):
47
- """Matplotlib posterior plot."""
48
- if backend_kwargs is None:
49
- backend_kwargs = {}
50
-
51
- backend_kwargs = {
52
- **backend_kwarg_defaults(),
53
- **backend_kwargs,
54
- }
55
-
56
- (figsize, ax_labelsize, titlesize, xt_labelsize, _linewidth, _) = _scale_fig_size(
57
- figsize, textsize, rows, cols
58
- )
59
- backend_kwargs.setdefault("figsize", figsize)
60
- backend_kwargs.setdefault("squeeze", True)
61
-
62
- if kind == "hist":
63
- kwargs = matplotlib_kwarg_dealiaser(kwargs, "hist")
64
- else:
65
- kwargs = matplotlib_kwarg_dealiaser(kwargs, "plot")
66
- kwargs.setdefault("linewidth", _linewidth)
67
-
68
- if ax is None:
69
- _, ax = create_axes_grid(
70
- length_plotters,
71
- rows,
72
- cols,
73
- backend_kwargs=backend_kwargs,
74
- )
75
- idx = 0
76
- for (var_name, selection, isel, x), ax_ in zip(plotters, np.ravel(ax)):
77
- _plot_posterior_op(
78
- idx,
79
- x.flatten(),
80
- var_name,
81
- selection,
82
- ax=ax_,
83
- bw=bw,
84
- circular=circular,
85
- bins=bins,
86
- kind=kind,
87
- point_estimate=point_estimate,
88
- round_to=round_to,
89
- hdi_prob=hdi_prob,
90
- multimodal=multimodal,
91
- skipna=skipna,
92
- ref_val=ref_val,
93
- rope=rope,
94
- ref_val_color=ref_val_color,
95
- rope_color=rope_color,
96
- ax_labelsize=ax_labelsize,
97
- xt_labelsize=xt_labelsize,
98
- **kwargs,
99
- )
100
- idx += 1
101
- ax_.set_title(
102
- labeller.make_label_vert(var_name, selection, isel), fontsize=titlesize, wrap=True
103
- )
104
-
105
- if backend_show(show):
106
- plt.show()
107
-
108
- return ax
109
-
110
-
111
- def _plot_posterior_op(
112
- idx,
113
- values,
114
- var_name,
115
- selection,
116
- ax,
117
- bw,
118
- circular,
119
- linewidth,
120
- bins,
121
- kind,
122
- point_estimate,
123
- hdi_prob,
124
- multimodal,
125
- skipna,
126
- ref_val,
127
- rope,
128
- ref_val_color,
129
- rope_color,
130
- ax_labelsize,
131
- xt_labelsize,
132
- round_to=None,
133
- **kwargs,
134
- ): # noqa: D202
135
- """Artist to draw posterior."""
136
-
137
- def format_as_percent(x, round_to=0):
138
- return "{0:.{1:d}f}%".format(100 * x, round_to)
139
-
140
- def display_ref_val():
141
- if ref_val is None:
142
- return
143
- elif isinstance(ref_val, dict):
144
- val = None
145
- for sel in ref_val.get(var_name, []):
146
- if all(
147
- k in selection and selection[k] == v for k, v in sel.items() if k != "ref_val"
148
- ):
149
- val = sel["ref_val"]
150
- break
151
- if val is None:
152
- return
153
- elif isinstance(ref_val, list):
154
- val = ref_val[idx]
155
- elif isinstance(ref_val, Number):
156
- val = ref_val
157
- else:
158
- raise ValueError(
159
- "Argument `ref_val` must be None, a constant, a list or a "
160
- 'dictionary like {"var_name": [{"ref_val": ref_val}]}'
161
- )
162
- less_than_ref_probability = (values < val).mean()
163
- greater_than_ref_probability = (values >= val).mean()
164
- ref_in_posterior = "{} <{:g}< {}".format(
165
- format_as_percent(less_than_ref_probability, 1),
166
- val,
167
- format_as_percent(greater_than_ref_probability, 1),
168
- )
169
- ax.axvline(
170
- val,
171
- ymin=0.05,
172
- ymax=0.75,
173
- lw=linewidth,
174
- alpha=0.65,
175
- color=vectorized_to_hex(ref_val_color),
176
- )
177
- ax.text(
178
- values.mean(),
179
- plot_height * 0.6,
180
- ref_in_posterior,
181
- size=ax_labelsize,
182
- weight="semibold",
183
- horizontalalignment="center",
184
- color=vectorized_to_hex(ref_val_color),
185
- )
186
-
187
- def display_rope():
188
- if rope is None:
189
- return
190
- elif isinstance(rope, dict):
191
- vals = None
192
- for sel in rope.get(var_name, []):
193
- # pylint: disable=line-too-long
194
- if all(k in selection and selection[k] == v for k, v in sel.items() if k != "rope"):
195
- vals = sel["rope"]
196
- break
197
- if vals is None:
198
- return
199
- elif len(rope) == 2:
200
- vals = rope
201
- else:
202
- raise ValueError(
203
- "Argument `rope` must be None, a dictionary like"
204
- '{"var_name": {"rope": (lo, hi)}}, or an'
205
- "iterable of length 2"
206
- )
207
- rope_text = [f"{val:.{format_sig_figs(val, round_to)}g}" for val in vals]
208
- ax.plot(
209
- vals,
210
- (plot_height * 0.02, plot_height * 0.02),
211
- lw=linewidth * 5,
212
- solid_capstyle="butt",
213
- zorder=0,
214
- alpha=0.7,
215
- color=vectorized_to_hex(rope_color),
216
- )
217
- probability_within_rope = ((values > vals[0]) & (values <= vals[1])).mean()
218
- ax.text(
219
- values.mean(),
220
- plot_height * 0.45,
221
- f"{format_as_percent(probability_within_rope, 1)} in ROPE",
222
- weight="semibold",
223
- horizontalalignment="center",
224
- size=ax_labelsize,
225
- color=vectorized_to_hex(rope_color),
226
- )
227
- ax.text(
228
- vals[0],
229
- plot_height * 0.2,
230
- rope_text[0],
231
- weight="semibold",
232
- horizontalalignment="right",
233
- size=ax_labelsize,
234
- color=vectorized_to_hex(rope_color),
235
- )
236
- ax.text(
237
- vals[1],
238
- plot_height * 0.2,
239
- rope_text[1],
240
- weight="semibold",
241
- horizontalalignment="left",
242
- size=ax_labelsize,
243
- color=vectorized_to_hex(rope_color),
244
- )
245
-
246
- def display_point_estimate():
247
- if not point_estimate:
248
- return
249
- point_value = calculate_point_estimate(point_estimate, values, bw, circular, skipna)
250
- sig_figs = format_sig_figs(point_value, round_to)
251
- point_text = "{point_estimate}={point_value:.{sig_figs}g}".format(
252
- point_estimate=point_estimate, point_value=point_value, sig_figs=sig_figs
253
- )
254
- ax.text(
255
- point_value,
256
- plot_height * 0.8,
257
- point_text,
258
- size=ax_labelsize,
259
- horizontalalignment="center",
260
- )
261
-
262
- def display_hdi():
263
- # np.ndarray with 2 entries, min and max
264
- # pylint: disable=line-too-long
265
- hdi_probs = hdi(
266
- values, hdi_prob=hdi_prob, circular=circular, multimodal=multimodal, skipna=skipna
267
- ) # type: np.ndarray
268
-
269
- for hdi_i in np.atleast_2d(hdi_probs):
270
- ax.plot(
271
- hdi_i,
272
- (plot_height * 0.02, plot_height * 0.02),
273
- lw=linewidth * 2,
274
- color="k",
275
- solid_capstyle="butt",
276
- )
277
- ax.text(
278
- hdi_i[0],
279
- plot_height * 0.07,
280
- f"{round_num(hdi_i[0], round_to)} ",
281
- size=ax_labelsize,
282
- horizontalalignment="right",
283
- )
284
- ax.text(
285
- hdi_i[1],
286
- plot_height * 0.07,
287
- f" {round_num(hdi_i[1], round_to)}",
288
- size=ax_labelsize,
289
- horizontalalignment="left",
290
- )
291
- ax.text(
292
- (hdi_i[0] + hdi_i[1]) / 2,
293
- plot_height * 0.3,
294
- f"{format_as_percent(hdi_prob)} HDI",
295
- size=ax_labelsize,
296
- horizontalalignment="center",
297
- )
298
-
299
- def format_axes():
300
- ax.yaxis.set_ticks([])
301
- ax.spines["top"].set_visible(False)
302
- ax.spines["right"].set_visible(False)
303
- ax.spines["left"].set_visible(False)
304
- ax.spines["bottom"].set_visible(True)
305
- ax.xaxis.set_ticks_position("bottom")
306
- ax.tick_params(
307
- axis="x", direction="out", width=1, length=3, color="0.5", labelsize=xt_labelsize
308
- )
309
- ax.spines["bottom"].set_color("0.5")
310
-
311
- if kind == "kde" and values.dtype.kind == "f":
312
- kwargs.setdefault("linewidth", linewidth)
313
- plot_kde(
314
- values,
315
- bw=bw,
316
- is_circular=circular,
317
- fill_kwargs={"alpha": kwargs.pop("fill_alpha", 0)},
318
- plot_kwargs=kwargs,
319
- ax=ax,
320
- rug=False,
321
- show=False,
322
- )
323
- elif values.dtype.kind == "i" or (values.dtype.kind == "f" and kind == "hist"):
324
- if bins is None:
325
- xmin = values.min()
326
- xmax = values.max()
327
- bins = get_bins(values)
328
- ax.set_xlim(xmin - 0.5, xmax + 0.5)
329
- kwargs.setdefault("align", "left")
330
- kwargs.setdefault("color", "C0")
331
- ax.hist(values, bins=bins, alpha=0.35, **kwargs)
332
- elif values.dtype.kind == "b":
333
- if bins is None:
334
- bins = "auto"
335
- kwargs.setdefault("color", "C0")
336
- ax.bar(["False", "True"], [(~values).sum(), values.sum()], alpha=0.35, **kwargs)
337
- hdi_prob = "hide"
338
- else:
339
- raise TypeError("Values must be float, integer or boolean")
340
-
341
- plot_height = ax.get_ylim()[1]
342
-
343
- format_axes()
344
- if hdi_prob != "hide":
345
- display_hdi()
346
- display_point_estimate()
347
- display_ref_val()
348
- display_rope()