-
Notifications
You must be signed in to change notification settings - Fork 2
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
Simulate data #3
Comments
I created a base R simulation function, and it helped create |
I wonder, would it not be better to simulate from fixed parameters in R to check consistency etc. ? We should be able to simulate from the prior predictive using |
Yeah, I think it makes sense to simulate from fixed parameters as well, e.g. to help with #11. And on reflection, would we really want to use |
I would for sake of consistency and then provide an extensive test suite. I would like to be able to simulate from the prior predictive and posterior predictive similar to what I stitched together in https://boehringer-ingelheim.github.io/oncomsm/articles/oncomsm.html and I think brms already offers that functionality - we just need to wrap it. |
I think we're converging on at least 3 types of simulations:
Is that right? Would we still also want prior predictive simulations from the |
Yes to all, prior predictive checking will be very handy for elicitation and irrespective of brms or direct stan it will always be a special case of posterior predictive, so 3) -> 1) I think prior predictive should also be possible with a fitted object, the question is whether we need that - I don't really see the use case for it. This raises an interesting question though - in a Bayesian framework, it makes a lot of sense differentiating between the non-fitted (prior) and fitted model objects which classical R / stats does not (there are only fitted objects). How do we want to handle that? We could have methods predictive() and sample() that work for non-fitted and fitted objects or prior_predictive() posterior_predictive() prior() posterior() for a single object. Any thoughts? |
Seems like the first step is to learn how to get a non-fitted brms object (could be obvious to you, but I have not looked into this). Then we could provide a function that is exactly like the current brms_model() in terms of its signature, except the model it returns is not fitted. At that point, maybe we could think about getting prior samples of parameters, marginals, etc. in a similar way the package already works with the posterior. This might make prior-vs-posterior comparisons easier using the current visualization functions. |
For the prior predictive distribution, I see that |
Hmm.... to simulate from the prior predictive distribution, So I propose the following roadmap:
|
Updates:
|
Completed, c.f. https://openpharma.github.io/brms.mmrm/articles/simulation.html |
With the basic package wrapper in place, I think this is a good place to start with the meaningful content.
@kkmann, @yonicd, and @chstock, I know we talked about using
brms
itself to simulate data. However, just for this first go-round, I think I would prefer to use ordinary R. Once we have that, we will have the beginnings of an interface. Then after we can fit abrms
model, it will be easier to go back and rewrite the internals of the simulation function to usebrms
. Sound reasonable?The text was updated successfully, but these errors were encountered: