I am using mpmath
to write a binomial beta function fit to calculate extremely small probabilities.
Most of the functions I need are already included in mpmath or easy to rewrite. Sadly, however, scipy.misc.comb
is not. I tried looking at the source code, but it seems to be based on some binom
function imported from a file in which I cannot find its code.
How could I rewrite the scipy comb function (or write my own) without using for/while loops to calculate the factorials?
Ok, so apparently
mpmath
does have a factorial function, with the deceptively intuitive name,mpmath.factorial
-.-So the solution to my query is simply: