The function computes widely applicable information criterion (WAIC) and efficient approximate leave-one-out cross-validation (LOO) from fitted regression model objects of class flexreg.
WAIC(model,...)## S3 method for class 'WAIC.flexreg'print(x,...)
Arguments
model: an object (or a list of objects) of class flexreg, usually the result of flexreg or flexreg_binom functions.
...: additional arguments.
x: an object of class WAIC.flexreg, usually the result of WAIC.
Returns
A named list with components from loo and waic.
Details
This function takes advantage of the loo package to compute the widely applicable information criterion (WAIC) and leave-one-out cross-validation (LOO) for objects of class flexreg. If a list of two or more objects of class flexreg is provided, the function returns the difference in their expected predictive accuracy (see loo_compare for further details).
Examples
## Not run:data("Reading")FB <- flexreg(accuracy.adj ~ iq, data = Reading, type="FB", n.iter=1000)WAIC(FB)## End(Not run)
References
Vehtari, A., Gelman, A., Gabry, J. (2017). 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