I need to compute the upper incomplete gamma function $$\Gamma(-0.5,0.5r)$$ But in MATLAB, the upper incomplete Gamma function "gammainc" is defined as $$\Gamma\left(\alpha ; x\right) = \dfrac{1}{\Gamma(\alpha)}\int\limits_{x}^{\infty}t^{\alpha - 1}e^{-t}\text{ d}t\text{.}$$ with parameter $\alpha > 0$.
When I type "gammainc(0.5,-0.5*1,'upper')", the MATLAB says "Error using gammainc, A must be real and non-negative!"
But actually what I want to get is defined as this From Wolfram MathWorld: $$\Gamma(\alpha;x) = \int\limits_{x}^{\infty}t^{a-1}e^{-t}\text{ d}t\text{.}$$ So what do I have to do to get the results in MATLAB ?
Please notice, in the Matlab Function (gammainc(x,a)) , the position of $\alpha$ and x is different, see the help. Due to the help, you should enter the codes as below:
$$ \Gamma(a,x) = {\Gamma(\alpha)}\ * \ gammainc(x,a,'upper')$$
In fact, it returns regularized incomplete Gamma function
Otherwise, if you know this tip check below:
Does the definition of the upper case incomplete gamma function $\Gamma(a,x)=\int_{x}^{\infty}e^{-t}\ t^{a-1}$ hold for any integer $a$?