Understanding parameters of beta family in brms

Hi,

in almost all cases, brms parametrizes the distributions so that the main predictor corresponds to the mean, so it uses the mu / phi parametrization.

Also, you can often gain insight into how stuff is implemented in brms by inspecting the generated Stan code via make_stancode

Yes, the parameter estimates from brms are before applying the inverse-link functions (you can inspect the default link functions at the help page for brmsfamily). However, to get accurate transformations, you generally need to work with individual samples and take summaries (e.g. mean) as the last step in the process. So a better way to compute estimate of a and b would be: for each sample, compute a value for a and b and then compute the mean of a and mean of b from those samples (this willl generally give somewhat different results than the method you’ve shown).

Also note, that you can use posterior_linpred, posterior_epred and prepare_predictions to simplify most of the common tasks.

Best of luck with your model!

4 Likes