Skip to content

How to switch from dBetaBinom_One() to dBetaBinom_v() and dBetaBinom_s()? #36

@maxdrohde

Description

@maxdrohde

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions