nt the log predictive density of the test data in the generated quantities block. The log sum of exponentials calculation must be done on the outside of Stan using the posterior draws of <span class="math inline">\(\log p(\tilde{y} \mid \tilde{x},
\theta^{(m)}).\)</span></p>
<p>Here is the code for evaluating the log posterior predictive density in a simple linear regression of the test data <span class="math inline">\(\tilde{y}\)</span> given predictors <span class="math inline">\(\tilde{x}\)</span> and tr