Hi all, I used the code for running diagnostics on my beta-binomial model from this vignette.
log_lik_beta_binomial2 <- function(i, prep) {
mu <- prep$dpars$mu[, i]
phi <- prep$dpars$phi
trials <- prep$data$vint1[i]
y <- prep$data$Y[i]
beta_binomial2_lpmf(y, mu, phi, trials)
}
The model converges fine. However, I get the following error when I try to run any diagnostics.
"argument “prep” is missing, with no default"
What seems to be the problem here?