compute_rsquared | R Documentation |
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)
yrep |
Matrix with rows representing samples and columns representing observations |
Bayesian R-squared (scalar, between 0 and 1)
N <- 50
N_sample <- 1e2
y <- runif(N, 0, 10)
yrep <- do.call(cbind,
lapply(1:N,
function(i) {
y[i] + rnorm(N_sample)
}))
compute_rsquared(yrep)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.