rzinb samples NAs when the size parameter is non-integer.
In the documentation, it states that, how you expect from rnbinom, the size should be > 0 but need not be integer.
sz <- seq(0.5,5.5,0.5)
rzinb(n = sz, size = sz, prob = 0.5, pi = 0)
## [1] NA 0 NA 0 NA 3 NA 2 NA 6 NA
It seems that within rng_zinb it throws a warning if the size parameter is non-integer, and automatically returns NA_REAL, while the R::rnbinom function would otherwise work fine also with non-integer size parameter.
rzinb samples NAs when the size parameter is non-integer. In the documentation, it states that, how you expect from rnbinom, the size should be > 0 but need not be integer.
With the same paramegers, the rnbinom works fine
It seems that within
rng_zinb
it throws a warning if the size parameter is non-integer, and automatically returnsNA_REAL
, while theR::rnbinom
function would otherwise work fine also with non-integer size parameter.