Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docstrings of ess, autocorr and bpv plots #2185

Merged
merged 16 commits into from
Jan 5, 2023
Prev Previous commit
Next Next commit
Update autocorrplot.py
Update the `plot_autorr` function's description and update the description of some arguments.
  • Loading branch information
asael697 authored and OriolAbril committed Jan 2, 2023
commit df3043d9b99f40e310ab4a003645fbbb1e387167
39 changes: 20 additions & 19 deletions arviz/plots/autocorrplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,37 +23,38 @@ def plot_autocorr(
backend_kwargs=None,
show=None,
):
"""Bar plot of the autocorrelation function for a sequence of data.
"""Bar plot of the autocorrelation function (ACF) for a sequence of data.

Useful in particular for posteriors from MCMC samples which may display correlation.
The ACF plots are useful as a convergence diagnostic for posteriors from MCMC
samples which may display correlation. The ACF is efficiently computed using a
Fast Fourier Transform for every lag for the input array.
asael697 marked this conversation as resolved.
Show resolved Hide resolved

Parameters
----------
data : InferenceData
data : obj
asael697 marked this conversation as resolved.
Show resolved Hide resolved
Any object that can be converted to an :class:`arviz.InferenceData` object
refer to documentation of :func:`arviz.convert_to_dataset` for details
var_names : list of str, optional
Variables to be plotted, if None all variables are plotted. Prefix the
variables by ``~`` when you want to exclude them from the plot. Vector-value
stochastics are handled automatically.
filter_vars : {None, "like", "regex"}, default=None
If `None` (default), interpret var_names as the real variables names. If "like",
interpret var_names as substrings of the real variables names. If "regex",
interpret var_names as regular expressions on the real variables names. A la
``pandas.filter``.
Variables to be plotted. Prefix the variables by ``~`` when you want to exclude
them from the plot. See the :ref:`this section <common_var_names>` for usage examples.
filter_vars : {None, "like", "regex"}, default None
If `None` (default), interpret `var_names` as the real variables names. If "like",
interpret `var_names` as substrings of the real variables names. If "regex",
interpret `var_names` as regular expressions on the real variables names. See
the :ref:`this section <common_filter_vars>` for usage examples.
max_lag : int, optional
Maximum lag to calculate autocorrelation. Defaults to 100 or num draws,
whichever is smaller.
combined : bool, default=False
Maximum lag to calculate autocorrelation. By Default, the plot displays the
first 100 lag or the total number of draws, whichever is smaller.
combined : bool, default False
Flag for combining multiple chains into a single chain. If False, chains will be
plotted separately.
grid : tuple
grid : tuple, optional
Number of rows and columns. Defaults to None, the rows and columns are
automatically inferred.
figsize : (float, float), optional
figsize : tuple, optional
asael697 marked this conversation as resolved.
Show resolved Hide resolved
Figure size. If None it will be defined automatically.
Note this is not used if ``ax`` is supplied.
textsize : float
textsize : float, optional
Text size scaling factor for labels, titles and lines. If None it will be autoscaled based
on ``figsize``.
labeller : Labeller, optional
Expand All @@ -68,8 +69,8 @@ def plot_autocorr(
Currently specifies the bounds to use for bokeh axes. Defaults to value set in ``rcParams``.
backend_kwargs : dict, optional
These are kwargs specific to the backend being used, passed to
:func:`matplotlib.pyplot.subplots` or
:func:`bokeh.plotting.figure`.
:func:`matplotlib.pyplot.subplots` or :func:`bokeh.plotting.figure`.
For additional documentation check the plotting method of the backend.
show : bool, optional
Call backend show function.

Expand Down