View source: R/postestimation.R
bayes_R2.hsstan | R Documentation |
Compute the Bayesian and the LOO-adjusted R-squared from the posterior samples. For Bayesian R-squared it uses the modelled residual variance (rather than the variance of the posterior distribution of the residuals). The LOO-adjusted R-squared uses Pareto smoothed importance sampling LOO residuals and Bayesian bootstrap.
## S3 method for class 'hsstan'
bayes_R2(object, prob = 0.95, summary = TRUE, ...)
## S3 method for class 'hsstan'
loo_R2(object, prob = 0.95, summary = TRUE, ...)
object |
An object of class |
prob |
Width of the posterior interval (0.95, by default). It is
ignored if |
summary |
Whether a summary of the distribution of the R-squared
should be returned rather than the pointwise values ( |
... |
Currently ignored. |
The mean, standard deviation and posterior interval of R-squared if
summary=TRUE
, or a vector of R-squared values with length equal to
the size of the posterior sample if summary=FALSE
.
Andrew Gelman, Ben Goodrich, Jonah Gabry and Aki Vehtari (2019), R-squared for Bayesian regression models, The American Statistician, 73 (3), 307-309. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/00031305.2018.1549100")}
Aki Vehtari, Andrew Gelman, Ben Goodrich and Jonah Gabry (2019), Bayesian R2 and LOO-R2. https://avehtari.github.io/bayes_R2/bayes_R2.html
# continued from ?hsstan
bayes_R2(hs.biom)
loo_R2(hs.biom)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.