Hi,

I would like to model my data using zero inflated beta binomial distribution. I can do beta binomial using the code available on the link below.

https://bookdown.org/connect/#/apps/1850/access

I wonder if brms has a zero inflated beta binomial distribution available? If not, is there a way that I can build one in brms? I am new to stan and brms. Previously the work was done under a frequentist framework.

Thanks a lot.

To implement this in brms you will have to use a â€ścustom response distributionâ€ť.

The brms vignette for this uses the beta binomial model.

This is a starting point, but to make this work you also need to code the zero inflation part. (i.e. you have so specify the design matrix, additional regression parameters, and implement the mixture-model to combine the zero inflation part with the beta binomial part.)

A good starting point for this is to specify a model with the zero inflated negative binomial family in brms (see here) and to use `make_stancode`

to produce the output, which you can then to inspect to see how zero inflation is implemented.

The harder part will then be to (a) generate a brms model with the stan code you generated and (b) write the `posterior_predict`

and `log_lik`

functions that are needed for post processing (but looking at the similar other brms functions) should also help with this.

3 Likes