waic_bgam function

Calls the loo package to calculate the widely applicable information criterion (WAIC)

Calls the loo package to calculate the widely applicable information criterion (WAIC)

Computes WAIC by calling the appropriate function from the loo package

waic_bgam(object, ...) ## S4 method for signature 'bayesGAMfit' waic_bgam(object, ...) ## S4 method for signature 'array' waic_bgam(object, ...)

Arguments

  • object: Object of type bayesGAMfit generated from bayesGAM.
  • ...: Additional parameters to pass to pass to loo::waic

Returns

a named list of class c("waic", "loo")

  • estimates: A matrix with two columns ("Estimate", "SE") and three rows ("elpd_waic", "p_waic", "waic"). This contains point estimates and standard errors of the expected log pointwise predictive density (elpd_waic), the effective number of parameters (p_waic) and the information criterion waic (which is just -2 * elpd_waic, i.e., converted to deviance scale).
  • pointwise: A matrix with three columns (and number of rows equal to the number of observations) containing the pointwise contributions of each of the above measures (elpd_waic, p_waic, waic).

Examples

f <- bayesGAM(weight ~ np(height), data = women, family = gaussian, iter=500, chains = 1) waic_bgam(f)

References

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).

Vehtari, A., Gelman, A., and Gabry, J. (2017b). Pareto smoothed importance sampling. preprint arXiv:1507.02646

Vehtari A, Gabry J, Magnusson M, Yao Y, Gelman A (2019). “loo: Efficient leave-one-out cross-validation and WAIC for Bayesian models.” R package version 2.2.0, <URL: https://mc-stan.org/loo>.

  • Maintainer: Samuel Thomas
  • License: GPL-3
  • Last published: 2022-03-17

Useful links