Variance-explained estimated via PSIS-LOO following brms'
loo_R2(): 1 - var_loo(y - yloo) / var_loo(y), where yloo is the
LOO-weighted posterior expectation (loo::E_loo() mean of posterior_epred)
and the variances use the same weighted-expecation construction as brms
(Gelman, Goodrich, Gabry & Vehtari 2018). Falls back to NA when epred or
the PSIS object is unavailable.
Constructor for R2LooMetric.
Examples
r2_loo_metric()
#> <bayesim::R2LooMetric>
#> @ name : chr "r2_loo"
#> @ needs : chr [1:2] "loo" "epred"
#> @ required : logi FALSE
#> @ summary_type: chr "mean"
#> @ schema :List of 3
#> .. $ value :List of 3
#> .. ..$ role : chr "estimate"
#> .. ..$ aggregation: chr "mean"
#> .. ..$ mcse : chr "sd"
#> .. $ elpd :List of 3
#> .. ..$ role : chr "estimate"
#> .. ..$ aggregation: chr "mean"
#> .. ..$ mcse : chr "sd"
#> .. $ undefined:List of 3
#> .. ..$ role : chr "diagnostic"
#> .. ..$ aggregation: chr "none"
#> .. ..$ mcse : chr "none"