When selecting my prior distributions, and especially determining their distributional parameters, I find it helpful to visualize and compare several options. I was wondering if people have any tips on doing this. Since I use brms, it would be ideal to be able to use the same or similar syntax for specifying the priors.
Toward this goal, I reimplemented many of stan’s univariate distribution functions from this link in R and saved them in a barebones package. This package allows me to visualize and compare distributions quickly:
However, I ran into several questions that I was hoping this community could help me answer:
-
Is it possible to directly access stan functions and their output from R?
It was a good learning experience for me to reimplement the stan functions, but this isn’t an ideal solution because its output will mismatch stan’s if updates are made to stan and not to mine. -
Can you think of a way to intelligently guess the appropriate range limits for the prior?
I currently force the user to specifyxlim
to display or else an uninformative range is defaulted. However, I figure someone smarter than me might know how to look at the function and its arguments itself and intelligently guess at an appropriate range that would capture most of its density. For example, could you automatically (and efficiently) identify the 1st and 99th percentile values?