WAIC for custom_family beta-binomial in brms

Hi,
I’m doing a beta-binomial model which I’ve made using the vignette for custom_family: https://github.com/paul-buerkner/custom-brms-families/commit/32c9f2bfc92abade64c91fe601a3e6370070d30b

However, I would like to calculate WAIC-values, as I’m comparing multiple models, but it does not seem to work with the custom_family argument. Any ideas of how to get WAIC values, or similar values for model comparison and selection, when I use the custom_family argument?

Best regards,

Hi Ida,

Have you defined your own log_lik function as they do in the tutorial?

Yes, I’ve defined it as they do in the vignette:

beta_binomial2 ← custom_family(
“beta_binomial2”,
dpars = c(“mu”, “phi”),
links = c(“logit”, “log”),
lb=c(0,0),
ub=c(1,NA),
type = “int”, vars = “trials[n]”,
log_lik = log_lik_beta_binomial2,
predict = predict_beta_binomial2,
fitted = fitted_beta_binomial2
)

Have you read the text under the section “Post-Processing Custom Family Models”?