-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add function: p_direction()
#90
Conversation
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## main #90 +/- ##
==========================================
- Coverage 96.64% 95.32% -1.33%
==========================================
Files 11 12 +1
Lines 865 877 +12
==========================================
Hits 836 836
- Misses 29 41 +12
☔ View full report in Codecov by Sentry. |
Thanks for the PR! However, I disagree with @devmotion that this functionality belongs in this package. Within the ArviZ project at least, we draw a distinction between a diagnostic, which tells us something about the quality of inference using the given inference method (here, some MCMC method) and a statistic, which tells us something about the posterior (or something derived from the posterior such as a posterior predictive distribution). So for example, it would not make sense to include HDI, LOO, WAIC, or LOO-PIT in this package, even though most of these are also implemented in this org for I'm splitting out ArviZ's statistics implementations into their own ArviZStats package (currently a submodule here), and this could potentially belong there. But in ArviZ we're careful to only include methods that have been thoroughly compared with other methods so that we can make informed recommendations about how and when to use them. I've personally never used p-directions before, so I would need to read more about them and in particular see how they are used in practice and how they relate to and perform compared to other notions of Bayesian p-values, e.g. those proposed in Section 6 of BDA3. |
Maybe we can add an |
Maybe it would be reasonable to not only split out ArvizStats in a standalone package but also generalize it to generic chains as MCMCDiagnosticTools (maybe MCMCStatistics would be a reasonable name), if that's not the case yet? |
For the reasons in #90 (comment) I don't think this belongs here at all. It's not specific to MCMC, and it is a posterior analysis, not a diagnostic of either an inference method or of a model. This would fall in the category of Bayesian hypothesis testing, which would be a nice package on its own or in a larger package.
ArviZStats is already generalized this way. In particular, every function has a method that operates on either arrays of Monte Carlo draws or an output of a previous analysis computed from MC draws. It does have convenience methods for InferenceObjects types, but these will be moved to an InferenceObjects-ArviZStats extension. Nothing in ArviZStats is MCMC-specific (it depends on this package only to set |
I must say that I do agree that this type of indices (also including other ones like region of practical equivalence - ROPE) are neither diagnostic indices nor specific to MCMC (and thus don't really fit here). A package for Turing-model testing would make sense if the goal is to add more indices (including Bayes Factors), but at this stage if it's just for one function it might be overkill. Perhaps it could be taken step by step, i.e., first add that to say MCMCChains, and once there is need & effort to create that additional package we move the appropriate functions there? |
Actually, @DominiqueMakowski, some of the ArviZ plots do use ROPE (e.g. |
Maybe something like PosteriorStats would be an alternative that would also fit with e.g. GP posteriors. Generally, I think a descriptive name is fine even if it is a bit general - we could always make it clear in the docs and README what's the intended scope of the package. |
Done! https://github.com/arviz-devs/PosteriorStats.jl. |
Closed in favour of arviz-devs/PosteriorStats.jl#10 |
Following the discussion here TuringLang/MCMCChains.jl#428, adding p_direction here defined for a
::AbstractArray{<:Union{Missing,Real}}