Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hurdles and zero inflated distributions #20

Open
njtierney opened this issue Feb 12, 2024 · 2 comments
Open

hurdles and zero inflated distributions #20

njtierney opened this issue Feb 12, 2024 · 2 comments

Comments

@njtierney
Copy link
Collaborator

After discussing with Francis Hui, the key ideas are as follows:

  • zero inflation means a distribution of 0s, plus a distribution that might already contain 0s.
  • truncation means a distribution of 0s, plus a truncated distribution of 1 onwards.
@hrlai
Copy link
Contributor

hrlai commented Feb 12, 2024

Great to see continued interest in this module! Just want to quickly refer back to #15 and #17 . Both PRs indeed parameterise zero inflation like you and Francis described above, e.g.:

zi <- binom$sample(seed = seed)
lbd <- negbin$sample(seed = seed)
(fl(1) - zi) * lbd

Also to note that in glmmTMB the distribution families with truncated_* prefixes are for hurdle models, i.e., they are truncated at 1. I think this is their design philosophy. Also note that Francis' boral package has the zero-truncated version of Poisson and negative binomial: https://rdrr.io/cran/boral/man/about.distributions.html as family = zt*

Hopefully these notes help to tidy up things.

@njtierney
Copy link
Collaborator Author

Thanks for that, @hrlai !

We've got a few other priorities at the moment with getting TF2 greta onto CRAN and the variety of issues around that. Hopefully that goes ahead quickly and I can focus my attention on this. Really keen to make it easy to add new and useful distributions to greta!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants