paul-buerkner / brms

brms R package for Bayesian generalized multivariate non-linear multilevel models using Stan
https://paul-buerkner.github.io/brms/
GNU General Public License v2.0
1.28k stars 184 forks source link

Implement the zero-inflated dirichlet distribution #722

Open jackobailey opened 5 years ago

jackobailey commented 5 years ago

Dirichlet regression is possible in brms using the dirichlet family. But this requires that outcomes be non-zero.

Election outcomes are one case where outcomes are distributed according to the dirichlet distribution (on the probability scale and sum to 1), but that exhibit considerable zero-inflation. This is often true where parties do not stand for whatever reason.

Rather than fudge this by replacing 0 with a tiny number, it would be good to be able to model the zero-inflation. Effectively, this would be a multinomial extension of the zero-inflated beta distribution in the same way that the dirichlet distribution is a multinomial extension of the standard beta distribution.

At present, this is possible using the zadr() function in the Compositional package. But this lacks a lot of functionality and is Frequentist, not Bayesian.

An accompanying paper for the Compositional package is available here. There is also another good paper detailing zero-inflated dirichlet regression in the context of microbiome data here.

manuelreif commented 4 years ago

Thank you Paul! I am also interested in using the zero-adjusted Dirichlet Distribution!

mansillo commented 4 years ago

Something like the zadr() function would be a very welcome addition to brms Paul.

wpetry commented 9 months ago

See also Stan implementation of a simplified set of models in the zoid package

andieich commented 1 month ago

@paul-buerkner Hi Paul, are there any updates on this? Or would you happen to have an idea of how to deal with many zeros in the data set otherwise? I'd to use the Dirichlet Distribution as a GAM.

paul-buerkner commented 1 month ago

I do not have time myself at the moment to implement this unfortunately but I would be happy to review a PR should someone decide to work on this feature.