Description Usage Arguments Value Examples
Compute difference (WAIC1 - WAIC2) in WAIC and its SE for two models.
1 | waic_diff(l_pred1, l_pred2)
|
l_pred1 |
A m1 x D matrix of predictive likelihoods (NOT log-likelihoods) from model 1. |
l_pred2 |
A m2 x D matrix of predictive likelihoods (NOT log-likelihoods) from model 2. |
A vector of (1) the difference in WAIC (on the deviance scale) between models and (2) the standard error of the difference in WAIC.
1 2 3 4 5 6 | data(teacher_rate)
fit_mlr <- gibbs_mlr(rating ~ grade, data = teacher_rate, m = 100)
fit_mlr2 <- gibbs_mlr(rating ~ grade + I(grade^2), data = teacher_rate, m = 100)
# Returns (1) D = WAIC(fit_mlr2) - WAIC(fit_mlr) and (2) SE(D)
# Suggests that a linear relationship is preferable
waic_diff(t(lpd(fit_mlr2)), t(lpd(fit_mlr)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.