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 bayesGAMfit
waic_bgam(object, ...)
# S4 method for array
waic_bgam(object, ...)
Object of type bayesGAMfit generated from bayesGAM.
Additional parameters to pass to pass to loo::waic
a named list of class c("waic", "loo")
estimatesA 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).
pointwiseA 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).
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<U+2013>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). <U+201C>loo: Efficient leave-one-out cross-validation and WAIC for Bayesian models.<U+201D> R package version 2.2.0, <URL: https://mc-stan.org/loo>.
# NOT RUN {
f <- bayesGAM(weight ~ np(height), data = women,
family = gaussian, iter=500, chains = 1)
waic_bgam(f)
# }
Run the code above in your browser using DataLab