-
Notifications
You must be signed in to change notification settings - Fork 5
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
Streamlined way to use powerscale with predictions from brms #18
Comments
Thanks for opening this issue. I completely agree that current way predictions are handled is far from ideal. If there's only one predicted variable (for example R2), it should work like I don't have an immediate solution for you as the way it is currently implemented is using I have been planning to transition from functions that operate on fit objects to functions that operate directly on |
This is related to paul-buerkner/brms#1534. I will likely incorporate the workaround posted there into priorsense as the change to brms will be incorporated in a later brms version. |
This is now improved in the separate-scaling branch, with the helper function @jflournoy your example should now work like this: priorsense::powerscale(
fit,
alpha = .9,
component = 'prior',
prediction = \(x) priorsense::predictions_as_draws(x, brms::posterior_epred, newdata = unique(x$data[, c('year', 'month')]))) The predictions are named |
I will test this out and report back. Thank you! |
works very nicely. Thanks for the fix! |
Amazing package and paper. Thank you! I suppose this is either a feature request or a cry for help. :)
I'm trying to look at sensitivity of the predictions from a
brms
model and my current implementation seems rather convoluted. I think a lot of this has to do first with the fact that brms does not provide chain and iteration info or that the functions in the posterior package don't extract this information properly. I have reproducible code below and though it works for the purpose, even after getting the prediction draws properly bound to the draws from the parameters, it's still a bit of rough work to get the data into shape for other purposes.Only the last powerscale call works
Package versions:
The text was updated successfully, but these errors were encountered: