Function like rstanarm::posterior_predict() for models written in Rstan?

While I’ve used great packages like brms and rstanarm in the past, I’ve begun working on writing my own models using Rstan. Although I’m starting out with just basic models, one issue I’ve already run into is not having the same functions I can rely on for different aspects of my workflow.

For example, what if I want draws from the posterior predictive distribution? Using rstanarm I’d just use posterior_predict() (and in brms I’d use tidybayes::add_predicted_draws()), so are there analogous functions for models written in Rstan?

No, because R does not know what know what distributions to draw from because it does not know what the Stan model was.

Oh wow, thanks for the info. That’s an absolutely huge downside of coding up my own models in Rstan. Will be sticking with brms or rstanarm.

Yes, although if you can write a Stan program that does something that rstanarm / brms can’t do, then drawing from the posterior predictive distribution in the generated quantities block is the about the easiest part of that whole process.

Got it. The generated quantities block is kind of a substitute for a calling the posterior predictive distribution after the fact using brms or rstanarm.