Closed jburos closed 7 years ago
Just an update. I've added posterior_predict functionality for stanjm objects. To do this I have adapted the posterior_predict method for stanreg objects, so that m can be passed an additional argument. This saves having to actually create a posterior_predict method for stanjm objects.
I have then added a new function call posterior_traj, which acts as a wrapper for posterior_predict. The details of this function are in the help file. There is also an associated plot method for objects returned by the posterior_traj function, called plot.predict.stanjm (which also has help documentation).
I've not added posterior predictions for the survival submodel yet.
At some point we will need to ask Ben/Jonah how they feel about adding plot methods for these objects to rstanarm. My impression is that they are trying to avoid having plot methods in rstanarm, and instead moving them to the bayesplot package and calling them from there.
Just to confirm I've merged these additions into the following branch:
This looks great - thanks @sambrilleman! This will be very useful.
Re plotting: maybe open an issue with Ben /Jonah re using bayesplot? A set of survival-related plot functions may be relevant, given the they are planning to eventually add basic survival analysis to rstanarm - see stan-dev/rstanarm#69
This should now be close I hope. I've added the following on the develop branch:
All of these should have documentation with them.
I'll wait until we've had a chance to check this stuff, and then close this issue once we merge the develop branch into the master branch.
The commit here brings most of this functionality into the master branch (merging develop4 into the master), so I will close this issue now since it is quite general. We can open new issues related to specific to bugs in any of these functions, as we find them.
This is a placeholder for work to first update and then migrate the
posterior_predict
functions from http://github.com/sambrilleman/rstanjm repo to this fork.Quoting Sam: