Extract the log likelihood from models fit by bayesGAM
Extract the log likelihood from models fit by bayesGAM
Convenience function for extracting the pointwise log-likelihood matrix or array from a model fit by bayesGAM. Calls the extract_log_lik method from the loo package
extract_log_lik_bgam(object,...)## S4 method for signature 'bayesGAMfit'extract_log_lik_bgam(object,...)
Arguments
object: Object of type bayesGAMfit generated from bayesGAM.
...: Additional parameters to pass to loo::extract_log_lik
Returns
A matrix with the extracted log likelihood values post-warmup
Examples
f <- bayesGAM(weight ~ np(height), data = women, family = gaussian, iter=500, chains =1)ll <- extract_log_lik_bgam(f)
References
Stan Development Team (2017). The Stan C++ Library, Version 2.16.0. https://mc-stan.org/
Stan Development Team (2017). RStan: the R interface to Stan, Version 2.16.1. https://mc-stan.org/
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>.
Vehtari A, Gelman A, Gabry J (2017). “Practical Bayesian model evaluation using leave-one-out cross-validation and WAIC.” Statistics and Computing, 27, 1413-1432. doi:10.1007/s11222-016-9696-4 (URL: https://doi.org/10.1007/s11222-016-9696-4).