R/stan_misc.R
compute_rsquared.Rd
The approach is not fully Bayesian and provides a global estimate rather than an estimate for each sample (this is because the predictive means and residual variance are estimated from replications than given by the model).
compute_rsquared(yrep)
Matrix with rows representing samples and columns representing observations
Bayesian R-squared (scalar, between 0 and 1)