1

I am using two hypergeomtric functions with MATLAB:

$_2F_1(a, b, a+1, d)$ and $_2F_1(a+1, b, a+2, d)$, where $d$ is from the open interval $(0,1)$ and $a > 0$, $b < 0$, all real numbers

However, evaluation in Matlab is extremely slow. Are there ways I can formulate this into another function that is much faster. Or, if there is any relationship between the 1st and 2nd hypergeometric functions? I would like to be able to reduce computation time by half possibly.

horchler
  • 3,258
  • 2
  • 27
  • 41

1 Answers1

0

Since the time of computation depends on an algorithm unknown to the user, one cannot give a definitive answer.

I suggest to compare the times of computation for the hypergeometric function and the incomplete Beta function : $$_2F_1(a,b,a+1,x)=a\:x^{-a}B_x(a,1-b)$$ $$_2F_1(a+1,b,a+2,x)=a\:x^{-(a+1)}B_x(a+1,1-b)$$ Also, compare with the direct numerical integration method. See equation (1) in : http://mathworld.wolfram.com/IncompleteBetaFunction.html $$_2F_1(a,b,a+1,x)=a\:x^{-a}\int_0^x \frac{t^{a-1}}{(1-t)^b}dt$$ $$_2F_1(a+1,b,a+2,x)=(a+1)\:x^{-(a+1)}\int_0^x \frac{t^{a}}{(1-t)^b}dt$$

Note : For $x=\epsilon$ close to $0$ the integral reduces to $\int_0^\epsilon \frac{t^{a-1}}{(1-t)^b}dt\simeq a^{-1}\epsilon^a$.

JJacquelin
  • 68,401
  • 4
  • 40
  • 91
  • $1-x$ should be $1-t$ in the integrand. – WimC Mar 10 '17 at 18:33
  • Of course, there was a typo (now corrected). Thank you for the remark. – JJacquelin Mar 10 '17 at 22:52
  • Thank you for the response. I did not know about the incomplete beta function. Will check this out. – user424072 Mar 11 '17 at 13:11
  • As a follow up to the question I posted and the response I received here, will the first identity given here relating the hypergeometric function with incomplete beta function also hold the same when a<0, a+1>0,b>0? – user424072 Dec 05 '17 at 17:03
  • If one use the integral definition for the Incomplete Beta function, the Integral is non longer convergent. Outside the range of convergence, one have to consider the analytic continuation in order to extend the definition of the fonction. In this context and as far as I know, the above relationship between Hypergeometric and Incomplete Beta functions continue to be valid. But this would require bibliographic search of references. – JJacquelin Dec 05 '17 at 18:59