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

Zero-adjusted negative binomial distributions #86

Merged
merged 15 commits into from Aug 18, 2022

Conversation

zeileis
Copy link
Collaborator

@zeileis zeileis commented Aug 18, 2022

To complement the hurdle Poisson and zero-inflated Poisson distribution I have added now the infrastructure for the corresponding negative binomial distributions. Additionally, I included zero-truncated Poisson and negative binomial distributions (i.e., distributions left-truncated at zero).

  • d/p/q/r functions (and documentation) for hnbinom, zinbinom, ztnbinom, and ztpois similar to the corresponding nbinom and pois functions from base R.
  • HurdleNegativeBinomial(), ZINegativeBinomial(), ZTNegativeBinomial(), and ZTPoisson() distribution constructors along with the corresponding documentation.
  • Corresponding S3 methods for the "usual" generics, except skewness(), and kurtosis() for which I didn't manage to work out the theoretical equations (yet).
  • Test scripts for all new distributions.
  • prodist() extractors for hurdle(), zeroinfl(), and zerotrunc() objects from either the pscl package or the countreg package (No additional dependencies are created because only the corresponding predict() method needs to be called.)

@alexpghayes alexpghayes merged commit 85e80a5 into alexpghayes:main Aug 18, 2022
@alexpghayes
Copy link
Owner

Looks great, thank you!

@zeileis zeileis deleted the zero-negbin branch August 18, 2022 14:52
@zeileis
Copy link
Collaborator Author

zeileis commented Aug 18, 2022

Wonderful, thanks for the quick merge. More PRs coming up... ;-)

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

Successfully merging this pull request may close these issues.

None yet

2 participants