Numerical instability with negative ell
mikeroswell opened this issue · 5 comments
mikeroswell commented
rarity(c(10,1),-1e4)
returns Inf
, should be about 1.1
mikeroswell commented
check out Rmpfr
https://cran.r-project.org/web/packages/Rmpfr/index.html
dushoff commented
Have you looked at how other Hill-calculating packages handle this?
mikeroswell commented
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).
mikeroswell commented
hillR
seems to have similar implementation to vegan
mikeroswell commented
resolved by adding a warning.