High exponent numbers with scipy.stats functions
You could just write the expression for logsf directly using logs of gamma functions from scipy.special (gammaln, loggamma). And you could send a pull request implementing the logsf for the chi-square distribution.
I have a set of number that can get very small, from 1e-100, to 1e-700 and lower. The precision doesn't matter as much as the exponent.
I can load such numbers just fine using Pandas by simply providing Decimal as a converter for all such numeric columns.
The problem is, even if I use Python's Decimal, I just can't use scipy.stats.chi2.isf and similar functions since their C code explicitly uses double.
A possible workaround is that I can use log10 of the numbers. The problem here is that although there is logsf function, for chi2 it's implemented as just log(sf(...)), and will, therefore, fail when sf returns 0 where it should've returned something like 1e-600. And for isf there is no such log function at all.
I wanted to know if there is any way to work with such numbers without resolving to writing all these functions myself for Decimal.