Add incomplete gamma functions
See original GitHub issuei.e., scipy.special.gammainc
and scipy.special.gammaincc
.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Incomplete gamma function - Wikipedia
In mathematics, the upper and lower incomplete gamma functions are types of special functions which arise as solutions to various mathematical problems such ......
Read more >Integral of incomplete gamma function - Math Stack Exchange
First: I fear that your initial integral is ill defined at 0 since the integrant will be equivalent to z−|M|−1Γ(A) there (for A>0 ......
Read more >Incomplete Gamma Function -- from Wolfram MathWorld
The "complete" gamma function Gamma(a) can be generalized to the incomplete gamma function Gamma(a,x) such that Gamma(a)=Gamma(a,0). This "upper" incomplete ...
Read more >Incomplete Gamma Function - an overview - ScienceDirect.com
Incomplete gamma functions are defined and their relations to the error function and the exponential integral are ... Adding these two relations, we...
Read more >expint: Exponential integral and incomplete gamma function
3 Incomplete gamma function dt, x > 0, a > 0. Function pgamma already implements this function in R (just note the differing...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Awesome, thanks for your interest!
AIUI there are basically two ways to add functions like these:
expit
orlogaddexp
lax.digamma
here.Interestingly, these two approaches are pretty similar: the XLA client libraries just implement functions in terms of XLA:HLO, and that’s exactly what we get when we write functions at the Python level in terms of the primitives in lax.py. That’s because the lax.py primitives are essentially 1:1 with XLA HLO (or in a few cases client library functions), so they translate to the same XLA computations. In general I think it’s easier and nicer to implement things in Python in terms of lax.py, but on the other hand for trickier numerical computations it can be good to reuse the effort in the XLA client library, and then we also get to share any updates or fixes across XLA frontends.
My guess is that (1) is the best approach to start with. On that front, I just noticed that @fehiepsi added some calculations involving incomplete gamma expressions in random.py, so that might be a good source of clues.
For approach (2) this seems like the relevant part of the XLA client math library but a quick glance didn’t turn up incomplete gamma stuff. Do you see any?
So overall my recommendation is to try implementing an incomplete gamma function in terms of lax.py primitives!
This was fixed by @srvasude in PR #2064 .