I'm trying to create a Nimble model with a beta-binomial distribution using the nimbleEcology package.
I started by trying the dBetaBinom_v() and dBetaBinom_s() functions but I couldn't get the MCMC to run properly because I think these functions expect a vector of observations, rather than a scalar. However, I saw that there used to be a function in this package, dBetaBinom_One(), which I used (by installing an old version of the this package) and the model worked correctly.
The relevant part of my Nimble code looks like this:
for (g in 1:G) {
p[g] <- expit(eta[g])
s1[g] <- phi * p[g]
s2[g] <- phi * (1 - p[g])
x[g] ~ dBetaBinom_One(
N = x_size,
shape1 = s1[g],
shape2 = s2[g]
)
}
Would you be able to let me know how to write this same model using the current version of the functions, either dBetaBinom_v() and dBetaBinom_s()? It may also be helpful to others who are having this issue and I would be happy to contribute a pull request to the documentation.
Thank you,
Max
I'm trying to create a Nimble model with a beta-binomial distribution using the
nimbleEcologypackage.I started by trying the
dBetaBinom_v()anddBetaBinom_s()functions but I couldn't get the MCMC to run properly because I think these functions expect a vector of observations, rather than a scalar. However, I saw that there used to be a function in this package,dBetaBinom_One(), which I used (by installing an old version of the this package) and the model worked correctly.The relevant part of my Nimble code looks like this:
Would you be able to let me know how to write this same model using the current version of the functions, either
dBetaBinom_v()anddBetaBinom_s()? It may also be helpful to others who are having this issue and I would be happy to contribute a pull request to the documentation.Thank you,
Max