stan-dev / posteriordb

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

Inference method database? #161

Closed eerolinna closed 4 years ago

eerolinna commented 4 years ago

Should there be an inference method database as well? Something like

library(inferencedb)
id <- idb_default() # Inference method database connection
inames <- inference_names(pd)

You could get information about inference methods

im <- inference_method("my_inference_method")
im$language == "R"
im$url == "https://github.com/eerolinna/my_inference_method"
im$keywords == c("variational inference")
im$author == "eerolinna"
im$citation == "some bibtex entry"
im$model_framework == "stan"

You could also run the inference method

im$run(model, data)

You could integrate the inference method with posteriordb

pdb <- pdb_default()
po <- posterior("eight_schools", pdb)
dat <- pdb_data(po)
model <- model_code(po, im$model_framework)
compiled_model <- stan_model(model)
im$run(compiled_model, dat) 
MansMeg commented 4 years ago

Wouldnt that be something to have in bayesbench?

eerolinna commented 4 years ago

Yes it would be possible to have this directly as a part of bayesbench, however I think it could also be useful outside of bayesbench. Just like posteriordb is used as a building block of bayesbench but can be useful outside of bayesbench too.

MansMeg commented 4 years ago

I agree. Although I think we should keep it as simple as possible for now. An inference database would, now, mainly raise the level of complexity.

eerolinna commented 4 years ago

I guess you mean that for now it is simpler to keep this kind of functionality directly as a part of bayesbench and maybe spin it out as a separate library later if needed? That's fair.

MansMeg commented 4 years ago

Exactly. You can read my mind. =) I close this issue for now.

eerolinna commented 4 years ago

Great! Closing this is fine.