CDCgov / Rt-without-renewal

https://cdcgov.github.io/Rt-without-renewal/
Apache License 2.0
21 stars 3 forks source link

tidybayes like gather_draws #363

Open seabbs opened 4 months ago

seabbs commented 4 months ago

As the title and see the docs for desired behaviour: https://search.r-project.org/CRAN/refmans/tidybayes/html/spread_draws.html

I think this would need to be implemented using tools from MCMCchains and DataFrames. The really key bit here is being able to specify multi-dimensional variables and get the output by a specified series of index variables. IMO this is such helpful functionality perhaps it should be an issue for somewhere in the Turing ecosystem?

SamuelBrand1 commented 4 months ago

IMO this is such helpful functionality perhaps it should be an issue for somewhere in the Turing ecosystem?

The (stalled?) changes to MCMCChains are laid out here https://github.com/TuringLang/MCMCChains.jl/issues/246

I think the blocker/tricky aspect of getting the full gather_draws and spread_draws functionality is how tricky it is to use AxisArrays with different shaped and hierarchical parameter groups (mentioned in issue).

seabbs commented 4 months ago

My read of that is that is a blocker for some other aspect? In terms of the functionality we want it seems quite easier if you make the user specify the dimensions of the output (as tidybases does) and use DataFrames (which seems like a natural thing to do aside from what they say in that issue...?

seabbs commented 4 months ago

So a lot of this work has been done in Arviz.jl (https://julia.arviz.org/ArviZ/stable/quickstart/) so perhaps we just use a light wrapper around their conversion from Turing function?

seabbs commented 4 months ago

Also we should use similar(y, Missing) more in our docs etc as that is very handy vs y = missing.