merliseclyde / BAS

BAS R package https://merliseclyde.github.io/BAS/
https://merliseclyde.github.io/BAS/
GNU General Public License v3.0
41 stars 16 forks source link

error in hypergeometric1F1 #79

Closed amarshankarc closed 3 months ago

amarshankarc commented 3 months ago

library(BAS)

beta_poisson_pmf1 <- function(x, alpha, beta) { numerator <- gamma(x + alpha) gamma(alpha + beta) hypergeometric1F1(x + alpha, x + alpha + beta, -1) denominator <- gamma(x + 1) gamma(alpha) gamma(x + alpha + beta) result <- numerator / denominator return(result) } beta_poisson_pmf1(1,2,3) probability mass function is negative is getting

merliseclyde commented 3 months ago

Duplicate of #78

Please read the documentation and use the flag log=FALSE as shown in reply to issue #78