Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Here's my current prototype. It depends on ggdist and distributional. ggdist has a nice
parse_prior
function to work with brms priors, but I noticed it gave errors for a bunch of cases, so I wrote a functionprep_brmsprior
which does some preprocessing of a brmsprior object to ensure no errors happen and to add the family/model links to the prior object.I also added a change to the bmm default_prior method to add a column to the prior with the link form.
Then we have a few functions for plotting distributions, but the main one is plot.brmsprior, which is a method for plot. So now you can do this:
Created on 2024-04-06 with reprex v2.1.0
A few problems:
t()
, but maybe it would be better to put the inverse link function there. But I'm also not sure how to communicate the parameter name that it is clear this is for the transformed parameter (e.g. currently for the transformed plot it saysintercept_kappa
, but this isexp(intercept_kappa)
Any thoughts or feedback, on the above things or anything else, are welcomed