-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add structure for likelihood to compute predictive distributions based on draws #112
Comments
Would this be an additional slot in the model info file like |
Im actually starting to think of this as a separate stan function for now (a separate stan file). Then we can add it along the way. |
So you're thinking that {
"name": "blr",
"keywords": [],
"title": "A Bayesian linear regression model with vague priors",
"description": "A Bayesian linear regression model with vague priors.",
"urls": [],
"model_code": {
"stan": "models/stan/blr.stan"
},
"likelihood_code": {
"stan": "models/stan/blr_likelihood.stan"
},
"references": null,
"added_date": "2019-11-29",
"added_by": "Mans Magnusson"
} |
Yes. Exactly! |
With PyMC there is no need for any extra code to compute predictive distributions posterior_predictive_samples = pymc.sample_posterior_predictive(draws, model=model) where model is any pymc model and draws are the posterior draws computed with pymc. It seems backwards to include Ideal solutionFrom my perspective the ideal solution seems like this
{
"name": "blr",
"model_implementations": {
"stan": "models/stan/blr.info.json",
"pymc": "models/pymc/blr.info.json"
}
} (some slots like
{
"code": "models/stan/blr.stan",
"likelihood": "models/stan/blr_likelihood.stan"
}
{
"code": "models/pymc/blr.py"
} |
I agree that this is probably the right way to go. Well spotted. |
How should we expose the likelihood/predictive distribution to users? In other words, if I have a posterior object Would it be something like These could be generalized to |
Yes, that would probably be a good idea |
Write a suggestion for the 8-schools example of how it should look and review it with Paul. The structure change suggested by @eerolinna needs to be done before @jarnefeltoliver starts to fill out the db. |
I have now implemented it, but I think it is simpler to just add a JSON object directly:
|
That's a good idea! |
Do we want to have an API that exposes the likelihood code? Something like stan_likelihood_code_file(po) that would for the blr posterior return Or is it sufficient that we have something like posterior_predictive_draws(po, framework = "stan") that essentially keeps the likelihood code file as an implementation detail instead of public API? Arguments for keeping the likelihood code file out of the public API
Arguments for adding the likelihood code to the public API
|
We would like to be able to produce the predictive distribution using stan likelihood file without any restrictions on how the posterior was computed. So in R we would have a function that uses the likelihood file but returns a predictive distribution. Although this does not necessarily need to expose the likelihood code as you say. I . have no good answer yet. |
In model slot.
The text was updated successfully, but these errors were encountered: