Skip to content

Commit

Permalink
Capitalized HDI everywhere it is used in text (#1244)
Browse files Browse the repository at this point in the history
* Capitalized HDI everywhere it is used in text

* fixed typo
  • Loading branch information
fonnesbeck authored Jun 17, 2020
1 parent 0ff892c commit 4fbd1e2
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## v0.x.x Unreleased

### New features
* loo-pit plot. The kde is computed over the data interval (this could be shorter than [0, 1]). The hdi is computed analitically (#1215)
* loo-pit plot. The kde is computed over the data interval (this could be shorter than [0, 1]). The HDI is computed analitically (#1215)
* Added `html_repr` of InferenceData objects for jupyter notebooks. (#1217)
* Added support for PyJAGS via the function `from_pyjags` in the module arviz.data.io_pyjags. (#1219)

Expand Down
2 changes: 1 addition & 1 deletion arviz/plots/backends/bokeh/forestplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ def forestplot(self, hdi_prob, quartiles, linewidth, markersize, ax, rope):
x=values[mid], y=y, size=markersize * 0.75, fill_color=color,
)
_title = Title()
_title.text = "{:.1%} hdi".format(hdi_prob)
_title.text = "{:.1%} HDI".format(hdi_prob)
ax.title = _title

return ax
Expand Down
2 changes: 1 addition & 1 deletion arviz/plots/backends/bokeh/hdiplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


def plot_hdi(ax, x_data, y_data, plot_kwargs, fill_kwargs, backend_kwargs, show):
"""Bokeh hdi plot."""
"""Bokeh HDI plot."""
if backend_kwargs is None:
backend_kwargs = {}

Expand Down
2 changes: 1 addition & 1 deletion arviz/plots/backends/matplotlib/forestplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ def forestplot(
color=color,
)
ax.tick_params(labelsize=xt_labelsize)
ax.set_title("{:.1%} hdi".format(hdi_prob), fontsize=titlesize, wrap=True)
ax.set_title("{:.1%} HDI".format(hdi_prob), fontsize=titlesize, wrap=True)
if rope is None or isinstance(rope, dict):
return
elif len(rope) == 2:
Expand Down
2 changes: 1 addition & 1 deletion arviz/plots/backends/matplotlib/hdiplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


def plot_hdi(ax, x_data, y_data, plot_kwargs, fill_kwargs, backend_kwargs, show):
"""Matplotlib hdi plot."""
"""Matplotlib HDI plot."""
if backend_kwargs is not None:
warnings.warn(
(
Expand Down
2 changes: 1 addition & 1 deletion arviz/plots/essplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def plot_ess(
--------
Plot local ESS. This plot, together with the quantile ESS plot, is recommended to check
that there are enough samples for all the explored regions of parameter space. Checking
local and quantile ESS is particularly relevant when working with hdi intervals as
local and quantile ESS is particularly relevant when working with HDI intervals as
opposed to ESS bulk, which is relevant for point estimates.
.. plot::
Expand Down
4 changes: 2 additions & 2 deletions arviz/plots/forestplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ def plot_forest(
show=None,
credible_interval=None,
):
"""Forest plot to compare hdi intervals from a number of distributions.
"""Forest plot to compare HDI intervals from a number of distributions.
Generates a forest plot of 100*(hdi_prob)% hdi intervals from
Generates a forest plot of 100*(hdi_prob)% HDI intervals from
a trace or list of traces.
Parameters
Expand Down
10 changes: 5 additions & 5 deletions arviz/plots/hdiplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,20 @@ def plot_hdi(
credible_interval=None,
):
r"""
Plot hdi intervals for regression data.
Plot HDI intervals for regression data.
Parameters
----------
x : array-like
Values to plot.
y : array-like
Values from which to compute the hdi. Assumed shape (chain, draw, \*shape).
Values from which to compute the HDI. Assumed shape (chain, draw, \*shape).
hdi_prob : float, optional
Probability for the highest density interval. Defaults to 0.94.
color : str
Color used for the limits of the hdi and fill. Should be a valid matplotlib color.
Color used for the limits of the HDI and fill. Should be a valid matplotlib color.
circular : bool, optional
Whether to compute the hdi taking into account `x` is a circular variable
Whether to compute the HDI taking into account `x` is a circular variable
(in the range [-np.pi, np.pi]) or not. Defaults to False (i.e non-circular variables).
smooth : boolean
If True the result will be smoothed by first computing a linear interpolation of the data
Expand All @@ -53,7 +53,7 @@ def plot_hdi(
fill_kwargs : dict
Keywords passed to `fill_between` (use fill_kwargs={'alpha': 0} to disable fill).
plot_kwargs : dict
Keywords passed to hdi limits.
Keywords passed to HDI limits.
ax: axes, optional
Matplotlib axes or bokeh figures.
backend: str, optional
Expand Down
2 changes: 1 addition & 1 deletion arviz/plots/loopitplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def plot_loo_pit(
hdi_kwargs = {}
hdi_kwargs.setdefault("color", to_hex(hsv_to_rgb(light_color)))
hdi_kwargs.setdefault("alpha", 0.35)
hdi_kwargs.setdefault("label", "Uniform hdi")
hdi_kwargs.setdefault("label", "Uniform HDI")

loo_pit_kwargs = dict(
ax=ax,
Expand Down
12 changes: 6 additions & 6 deletions arviz/stats/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ def hdi(
Examples
--------
Calculate the hdi of a Normal random variable:
Calculate the HDI of a Normal random variable:
.. ipython::
Expand All @@ -422,21 +422,21 @@ def hdi(
...: data = np.random.normal(size=2000)
...: az.hdi(data, hdi_prob=.68)
Calculate the hdi of a dataset:
Calculate the HDI of a dataset:
.. ipython::
In [1]: import arviz as az
...: data = az.load_arviz_data('centered_eight')
...: az.hdi(data)
We can also calculate the hdi of some of the variables of dataset:
We can also calculate the HDI of some of the variables of dataset:
.. ipython::
In [1]: az.hdi(data, var_names=["mu", "theta"])
If we want to calculate the hdi over specified dimension of dataset,
If we want to calculate the HDI over specified dimension of dataset,
we can pass `input_core_dims` by kwargs:
.. ipython::
Expand Down Expand Up @@ -527,7 +527,7 @@ def _hdi(ary, hdi_prob, circular, skipna):


def _hdi_multimodal(ary, hdi_prob, skipna, max_modes):
"""Compute hdi if the distribution is multimodal."""
"""Compute HDI if the distribution is multimodal."""
ary = ary.flatten()
if skipna:
ary = ary[~np.isnan(ary)]
Expand Down Expand Up @@ -1029,7 +1029,7 @@ def summary(
If True, use the statistics returned by ``stat_funcs`` in addition to, rather than in place
of, the default statistics. This is only meaningful when ``stat_funcs`` is not None.
hdi_prob: float, optional
hdi interval to compute. Defaults to 0.94. This is only meaningful when ``stat_funcs`` is
HDI interval to compute. Defaults to 0.94. This is only meaningful when ``stat_funcs`` is
None.
order: {"C", "F"}
If fmt is "wide", use either C or F unpacking order. Defaults to C.
Expand Down

0 comments on commit 4fbd1e2

Please sign in to comment.