From d818525298e28f8acb7e587a3baa35fc0fc67a2b Mon Sep 17 00:00:00 2001 From: Audrey Yeo Date: Thu, 24 Aug 2023 15:39:13 +0200 Subject: [PATCH] Update R/dbetabinom.R Co-authored-by: Daniel Sabanes Bove --- R/dbetabinom.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/dbetabinom.R b/R/dbetabinom.R index fb390b4a..59bf9755 100644 --- a/R/dbetabinom.R +++ b/R/dbetabinom.R @@ -29,7 +29,7 @@ dbetabinom <- function(x, m, a, b, log = FALSE) { assert_number(a, lower = 0, finite = TRUE) assert_number(b, lower = 0, finite = TRUE) logRet <- lchoose(m, x) + lbeta(x + a, m - x + b) - lbeta(a, b) - if (log == FALSE) { + if (!log) { exp(logRet) } else { logRet