Closed DominiqueMakowski closed 1 year ago
Yeah I think something like this is definitely doable. I was already thinking about making curve_interval generic so that posterior::rvar objects could be passed to it. Internally since rvars just wrap an array where the first dimension is draws any changes to support that would also make it easy to have an implementation of the generic for matrices.
I added a pretty simple implementation of curve_interval()
for rvars and for matrices (for the latter, draws must be the first dimension). In that implementation, it assumes you want intervals for all variables joint with each other (i.e. you can't set .along
), since if you want to set .along
you might as well put it into a data frame format anyway. Not sure if you're still wanting to use this somewhere, but if you are and it doesn't work for you, let me know.
Hi! We're currently trying to provide support for
curve_interval
in easystats (https://github.com/easystats/bayestestR/issues/455). Due to how our API is organized, it would be helpful to have a method that works on "regular" draws matrices (e.g., such as one fromas.data.frame(some_rstanarm_model)
), rather than grouped dataframes, since we don't have dplyr/tibble as dependencies.Is it something that is possible to implement? Here's a reproduction of the first example in https://mjskay.github.io/ggdist/reference/curve_interval.html, but using bayestestR's formats of inputs/outputs:
Created on 2021-08-18 by the reprex package (v2.0.1)
I would like to compute the curvewise interval without, if possible, reshaping to long + grouping the iteration dataframe. As always, thanks :)