3 ms·
If you are unable to find a log-gamma function lying around, rewrite the above equation in terms of factorials using Γ(z)=(z−1)!, and notice that there are an e
by jessaustin 12y ago
If you are unable to find a log-gamma function lying around, rewrite the above equation in terms of factorials using Γ(z)=(z−1)!, and notice that there are an equal number of multiplicative terms in the numerator and denominator. If you alternately multiply and divide one term at a time, you should be able to arrive at an answer without encountering numerical overflow.
Something about the right side of the equation immediately preceding this quote seems to indicate that many of the terms in the numerator would cancel with equivalents in the denominator. I'm not really familiar with CAS systems, but is this the sort of thing they could do? Doing this simplification once when one writes the code seems to be a win over calculating the original expression every time the code runs.
- nimish 12y agoYes but numerically approximating the beta function is extremely fast, much faster than running a CAS optimization routine and possibly faster than going through the factorials! Not really worth it unless this is in an inner-loop.
- avibryant 12y agoI had the same thought, and went down the simplification rabbit-hole. Here's where I ended up: https://gist.github.com/avibryant/545e63b446a840951d5e https://gist.github.com/avibryant/545e63b446a840951d5e