wwiecek / baggr

R package for Bayesian meta-analysis models, using Stan
GNU General Public License v3.0
46 stars 12 forks source link

Making priors stored in baggr objects more understandable to the users #175

Open johanna-einsiedler opened 1 year ago

johanna-einsiedler commented 1 year ago

This is more of a question than a request:

I was unable to find an explanation of the parameters of fitted baggr models. e.g. there is the parameter 'formated_prior' which has an attribute 'prior_hypermean_fam' which is 1 in the default. However, I wasn't able to find out what 1 means in this case or what the values of 'priof_hypermean_val' stand for.

Sorry in case I overlooked something. Would be great if you could point me in the right direction.

Thanks a lot and big kudos for building this package!

wwiecek commented 1 year ago

Thanks for asking! These formatted priors are simply translations of either the user-specified or manually assigned priors into Stan syntax. So they are not fitted parameters, they are obtained before Stan is ran. I store them in baggr object so that there is a clear record of what prior was. You can see how they are used in this Stan file:

https://github.com/wwiecek/baggr/blob/master/inst/stan/functions/prior_increment.stan

Baiscally, _fam controls what family of distributions is used, and then _val or _value is fed in. The function I linked evaluates (probability density of) the prior

If you let me know more about your use case, I can make sure this is presented/documented a bit better. I have some unfinished functions for printing out priors.