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 diagnostics #1366

Merged
merged 15 commits into from
Sep 2, 2020
14 changes: 13 additions & 1 deletion arviz/stats/diagnostics.py
Original file line number Diff line number Diff line change
@@ -536,7 +536,19 @@ def _bfmi(energy):


def _backtransform_ranks(arr, c=3 / 8):
"""Backtransformation of ranks."""
"""Backtransformation of ranks.
canyon289 marked this conversation as resolved.
Show resolved Hide resolved

Parameters
----------
arr : np.ndarray
Ranks array
c : float
Fractional offset. Defaults to c = 3/8 as recommended by Bloom (1985).
ahartikainen marked this conversation as resolved.
Show resolved Hide resolved

Returns
-------
np.ndarray
"""
arr = np.asarray(arr)
size = arr.size
return (arr - c) / (size - 2 * c + 1)