Closed sethaxen closed 1 year ago
Totals | |
---|---|
Change from base Build 4399022657: | 0.08% |
Covered Lines: | 830 |
Relevant Lines: | 859 |
Patch coverage: 100.00
% and project coverage change: +0.08
:tada:
Comparison is base (
304ecb2
) 96.56% compared to head (253c911
) 96.64%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
I think it's a reasonable and useful generalization, I mainly have some minor concerns regarding the implementation.
A potentially more flexible approach is for our methods to accept a dims
keyword representing sample dimension(s), with shape (draw_dim[, chain_dim])
or draw_dim
, with all other dimensions interpreted as param dimensions If something like _sample_dims
was used to set the defaults, and we added this to the API, then arbitrary ordering of dimensions could be supported, and packages could even overload this method if the type of the array informs a different set of defaults.
But I think this would be slightly more complicated to support. e.g. _eachparam
pre-v1.9 would first need to use PermutedDimsArray
to bring the param dimensions together and then eachslice
.
EDIT: and then it might be jarring that we drop the dims
as opposed to the estimators in Statistics/StatsBase.
EDIT EDIT: but I suppose we could follow eachslice
in v1.9 and add a drop=true
keyword to control this.
I just ran into an issue in a package where it would be useful to have this functionality (and e.g., be able to call mcse
with vectors of draws again). Apart from the last comments, it seems this PR is ready?
Apart from the last comments, it seems this PR is ready?
Just about, I think. Will take a closer look later today.
One suggestion would be to also add an internal function for flattening zero-dimensional arrays to scalars, something like
Done!
Are there other functions that should be generalized?
In principle all of the older diagnostics could be generalized. But for the reasons given in https://github.com/TuringLang/MCMCDiagnosticTools.jl/pull/82#issuecomment-1556268129, I would consider this lower priority so that it shouldn't hold up this PR. if we choose to do this, this could be its own PR.
This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Totals | |
---|---|
Change from base Build 4399022657: | 0.08% |
Covered Lines: | 832 |
Relevant Lines: | 861 |
Following #78, this updates
rstar
,mcse
,ess
,ess_rhat
, andrhat
to support inputs of shape(draw, [chain[, params...]])
.To-do
ndims(x) > 0
Example