Does anyone have any examples of producing the expectation of the posterior predictive (i.e. what `brms`

does with `epred`

functions) in Stan (presumably in the `generated quantities`

block)? The User’s Guide has good examples of generating the posterior predictive distribution of \tilde{y} from new predictor data \tilde{x}. However, this is the posterior of \tilde{y} and not the posterior of E[\tilde{y}].

I imagine an ideal example would show how to predict that quantity for a single data new data point from a relatively simple hierarchical model.