-
-
Notifications
You must be signed in to change notification settings - Fork 411
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
Stats docs [GSoC] #670
Stats docs [GSoC] #670
Conversation
It allows to print python generated text to the docs
LGTM |
These are annoying
|
I will probably finish around Monday, having included simple examples for all functions in stats and diagnostics. |
Ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
|
||
Notes | ||
----- | ||
The basic ess diagnostic is computed by: | ||
|
||
.. math:: \hat{N}_{eff} = \frac{MN}{\hat{\tau}} | ||
.. math:: \hat{\tau} = -1 + 2 \sum_{t'=0}^K \hat{P}_t' | ||
.. math:: \hat{\tau} = -1 + 2 \sum_{t'=0}^K \hat{P}_{t'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch
@@ -311,7 +370,7 @@ def rhat(data, *, var_names=None, method="rank"): | |||
|
|||
|
|||
def mcse(data, *, var_names=None, method="mean", prob=None): | |||
"""Calculate Markov Chain Standard Error for statistic. | |||
"""Calculate Markov Chain Standard Error statistic. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it'd be cool to have a reference for this eventually (but certainly not needed in this PR)
...: "5%": lambda x: np.percentile(x, 5), | ||
...: "median": lambda x: np.percentile(x, 50), | ||
...: "95%": lambda x: np.percentile(x, 95), | ||
...: } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is nice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a comment
arviz/stats/diagnostics.py
Outdated
@@ -196,13 +202,13 @@ def ess(data, *, var_names=None, method="bulk", relative=False, prob=None): | |||
|
|||
.. ipython:: | |||
|
|||
In [2]: az.ess(data, relative=True, var_names=["mu", "theta_t"]) | |||
In [1]: az.ess(data, relative=True, var_names=["mu", "theta_t"]) | |||
|
|||
Calculate the ess using the "tail" method, which requires the `prob` argument |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is optional, by default it should not be used.
Because the default is what avehtari et al are using.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you prefer to remove it or to add a note advising against it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe remove it. I added it as an optional so one can do symmetrical minimum for different quantiles. Or maybe add a comment, but don't provide it in the example.
So if users thinks prob=0.1 is better then tail calculates symmetrical tail with that (min(ess_0.1, ess_1-0.1))
Co-Authored-By: Colin <ColCarroll@users.noreply.github.com>
Thanks, @OriolAbril ! |
Hi, sorry to comment too late, but yes I think the |
Oh, sorry, I missunderstood. I will fix it in #678. I wanted to merge this before getting into more lengthy work so that docs are updated as soon as possible. |
Minor fixes on stats module docs and adding examples. Fixes #631