mikeroswell/MeanRarity

Numerical instability with negative ell

mikeroswell opened this issue · 5 comments

rarity(c(10,1),-1e4) returns Inf, should be about 1.1

Have you looked at how other Hill-calculating packages handle this?

Good question. vegan fails sooner with low ell: vegan::renyi(c(10,1), scales =7818, hill=T); returns Inf but MeanRarity::rarity(c(10,1), q= 7818) works, but is better with high ell, where q=-296 fails for MeanRarity::rarity but not vegan::renyi. Need to explore implementation (guessing use of logs and exponents).

hillR seems to have similar implementation to vegan

resolved by adding a warning.