stan-dev / posteriordb

Database with posteriors of interest for Bayesian inference
181 stars 36 forks source link

R: make stan_code, dataset etc more generic #29

Closed eerolinna closed 4 years ago

eerolinna commented 5 years ago

Right now we have

po <- posterior("8_schools-8_schools_centered", my_pdb)
dataset(po)
stan_code(po)

It would be nice to also have something like

mo <- model("8_schools_centered", my_pdb)
stan_code(mo)

and

da <- data("8_schools", my_pdb)
dataset(da)
eerolinna commented 5 years ago

The python package has generic versions of stan_code, dataset etc

po = Posterior("8_schools-8_schools_centered", my_pdb)
po.dataset()
po.stan_code()

mo = Model("8_schools_centered", my_pdb)
mo.stan_code()

da = Data("8_schools", my_pdb)
da.dataset()

I think it would be good to have them in the R version too.

Lets say the user only wants to find the stan code for blr. Currently in R they first need to find some posterior that has blr as the model and only then they can access the stan code. If stan_code was a generic function then it would not be necessary to search for a posterior and they could just directly obtain the stan code from the blr model.

MansMeg commented 5 years ago

I agree!

eerolinna commented 4 years ago

So this is going to happen? Or was this closed as this is kind of same as #105?

MansMeg commented 4 years ago

It has already been fixed. Should have mentioned that.