twolodzko / extraDistr

Additional univariate and multivariate distributions
51 stars 11 forks source link

rdirmnom produces NaNs #3

Closed itcarroll closed 7 years ago

itcarroll commented 7 years ago
alpha <- c(1.480592e+00, 1.394943e-03, 4.529932e-06, 3.263573e+00, 4.554952e-06)
rdirmnom(10, 100, alpha)

More often than not, I'll get NaNs in the result.

twolodzko commented 7 years ago

@itcarroll it seems to be an underflow issue. If you have more examples like this I'd be grateful for sharing them since it would make it easier for me to make sure the problem is solved. I hope to fix it in next CRAN release. I'll submit fixed version of the code in the github version in the next few days, so you can use it until the CRAN update.