venpopov / bmm

An R package for easy and flexible Bayesian Measurement Modeling
https://venpopov.github.io/bmm/
GNU General Public License v2.0
12 stars 3 forks source link

Renaming get_model_prior to get_prior()? #132

Closed venpopov closed 7 months ago

venpopov commented 7 months ago

I know brms already has a get_prior() function.

But we can make a get_prior() into an S3 method, that has

get_prior.default() method:

get_prior.default(formula, data, ...) {
   brms::get_prior(formula, data, ...)
}

and a method

get_prior.bmmformula(formula, data, ...) {
 # existing get_model_prior function code
}

that way we have just one function that works with both bmm and brms and makes it simpler and more intuitive for people used to the get_prior() from brms

venpopov commented 7 months ago

Similarly with make_stancode and make_standata

GidonFrischkorn commented 7 months ago

The question to me is, if we would have to ask Paul if he would change the get_prior function into a method in brms or if we can do so independently? A second point is that the arguments passed to get_prior are different when calling it for a brms versus a bmm model (e.g. brms requires family, in bmm you call model). I do not have an intuition how much of a problem that is. If not than having it as a method either calling the brms version for any regular model called by brms and then our bmm version for any bmmmodels would be great.