From 7d2338cffdb92e47dabba55bb896f732c176b1ee Mon Sep 17 00:00:00 2001 From: Achim Zeileis Date: Sat, 8 Oct 2022 03:00:23 +0200 Subject: [PATCH] Patch CDF equation HurdleNegativeBinomial (#96) * fix equation for CDF of HurdleNegativeBinomial (analogous to fix of HurdlePoisson by @dkwhu) * re-run devtools::document() for updated in CDF equation in HurdlePoisson and HurdleNegativeBinomial * include CDF fixes in NEWS --- NEWS.md | 4 ++++ R/HurdleNegativeBinomial.R | 4 ++-- man/HurdleNegativeBinomial.Rd | 4 ++-- man/HurdlePoisson.Rd | 4 ++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/NEWS.md b/NEWS.md index bccfbead..6571e166 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,9 @@ # distributions3 (development version) +- Fixed errors in notation of cumulative distribution function in the documentation of + `HurdlePoisson()` and `HurdleNegativeBinomial()` (by @dkwhu in #94 and #96). + + # distributions3 0.2.1 - New generics `is_discrete()` and `is_continous()` with methods for all distribution objects diff --git a/R/HurdleNegativeBinomial.R b/R/HurdleNegativeBinomial.R index 6f076474..dcc83eb9 100755 --- a/R/HurdleNegativeBinomial.R +++ b/R/HurdleNegativeBinomial.R @@ -153,9 +153,9 @@ rhnbinom <- function(n, mu, theta, size, pi) { #' **Cumulative distribution function (c.d.f.)**: \eqn{P(X \le 0) = 1 - \pi} and for \eqn{k > 0} #' #' \deqn{ -#' P(X = k) = 1 - \pi + \pi \cdot \frac{F(k; \mu, \theta)}{1 - F(0; \mu, \theta)} +#' P(X \le k) = 1 - \pi + \pi \cdot \frac{F(k; \mu, \theta) - F(0; \mu, \theta)}{1 - F(0; \mu, \theta)} #' }{ -#' P(X = k) = 1 - \pi + \pi \cdot F(k; \mu, \theta)/(1 - F(0; \mu, \theta)) +#' P(X \le k) = 1 - \pi + \pi \cdot (F(k; \mu, \theta) - F(0; \mu, \theta))/(1 - F(0; \mu, \theta)) #' } #' #' **Moment generating function (m.g.f.)**: diff --git a/man/HurdleNegativeBinomial.Rd b/man/HurdleNegativeBinomial.Rd index 2aa90ed9..ad76c887 100755 --- a/man/HurdleNegativeBinomial.Rd +++ b/man/HurdleNegativeBinomial.Rd @@ -64,9 +64,9 @@ distribution. \strong{Cumulative distribution function (c.d.f.)}: \eqn{P(X \le 0) = 1 - \pi} and for \eqn{k > 0} \deqn{ - P(X = k) = 1 - \pi + \pi \cdot \frac{F(k; \mu, \theta)}{1 - F(0; \mu, \theta)} + P(X \le k) = 1 - \pi + \pi \cdot \frac{F(k; \mu, \theta) - F(0; \mu, \theta)}{1 - F(0; \mu, \theta)} }{ - P(X = k) = 1 - \pi + \pi \cdot F(k; \mu, \theta)/(1 - F(0; \mu, \theta)) + P(X \le k) = 1 - \pi + \pi \cdot (F(k; \mu, \theta) - F(0; \mu, \theta))/(1 - F(0; \mu, \theta)) } \strong{Moment generating function (m.g.f.)}: diff --git a/man/HurdlePoisson.Rd b/man/HurdlePoisson.Rd index d3208b64..4da87e33 100755 --- a/man/HurdlePoisson.Rd +++ b/man/HurdlePoisson.Rd @@ -52,9 +52,9 @@ distribution. \strong{Cumulative distribution function (c.d.f.)}: \eqn{P(X \le 0) = 1 - \pi} and for \eqn{k > 0} \deqn{ - P(X = k) = 1 - \pi + \pi \cdot \frac{F(k; \lambda)}{1 - F(0; \lambda)} + P(X \le k) = 1 - \pi + \pi \cdot \frac{F(k; \lambda) - F(0; \lambda)}{1 - F(0; \lambda)} }{ - P(X = k) = 1 - \pi + \pi \cdot F(k; \lambda)/(1 - F(0; \lambda)) + P(X \le k) = 1 - \pi + \pi \cdot (F(k; \lambda) - F(0; \lambda))/(1 - F(0; \lambda)) } where \eqn{F(k; \lambda)} is the c.d.f. of the \code{\link{Poisson}} distribution.