R/model_comparison.R
waic.rater_fit.RdCompute the WAIC - a measure of model fit - of a rater fit object.
# S3 method for class 'rater_fit'
waic(x, ...)A waic/loo object.
This function provides provides an additional method for model
comparison, on top of the loo() function. In general we recommend that
loo() is preferred: see the documentation of the loo package for details.
Also, note the comments regarding model selection the the details section
of loo().
Watanabe, S. (2010). Asymptotic equivalence of Bayes cross validation and widely application information criterion in singular learning theory. Journal of Machine Learning Research 11, 3571-3594.
Vehtari, A., Gelman, A., and Gabry, J. (2017a). Practical Bayesian model evaluation using leave-one-out cross-validation and WAIC. Statistics and Computing. 27(5), 1413–1432. doi:10.1007/s11222-016-9696-4 (journal version, preprint arXiv:1507.04544).
# \donttest{
fit_ds <- rater(anesthesia, "dawid_skene", verbose = FALSE, chains = 1)
fit_ccds <- rater(anesthesia, "class_conditional_dawid_skene",
verbose = FALSE, chains = 1)
waic(fit_ds)
#> Warning:
#> 20 (44.4%) p_waic estimates greater than 0.4. We recommend trying loo instead.
#>
#> Computed from 1000 by 45 log-likelihood matrix.
#>
#> Estimate SE
#> elpd_waic -234.0 16.9
#> p_waic 20.0 2.5
#> waic 468.0 33.9
#>
#> 20 (44.4%) p_waic estimates greater than 0.4. We recommend trying loo instead.
waic(fit_ccds)
#> Warning:
#> 8 (17.8%) p_waic estimates greater than 0.4. We recommend trying loo instead.
#>
#> Computed from 1000 by 45 log-likelihood matrix.
#>
#> Estimate SE
#> elpd_waic -245.9 18.1
#> p_waic 10.6 1.3
#> waic 491.7 36.2
#>
#> 8 (17.8%) p_waic estimates greater than 0.4. We recommend trying loo instead.
# }