12
1 Gamma Functions, Beta Functions, and Related
arguments “z,a” and the optional 3rd argument “lu” with values ’‘lower”, or “upper”
(“l”,“u”,“lo”,“up”) in dependence of the integral tail. The class properties are
res for the first derivative of the incomplete gamma function, resd2 for the
second derivative, info is the information about the integral tail, and ina, inz
the integral input values “a, z”. diincgammaC supports the same methods as
incgammaC and in addition its own surf-method. The syntax is [h1, h2, h3]
= surf(obj,ax,was,loga,dd), with “obj” the class object. All other input
variables are optional. “ax” allows either the input variable ‘z’ (default) or ‘a’ to
be selected as the plot axis; “was” what shall be plotted, the real or absolute etc.
function value, with values ‘real’, ‘imag’, ‘abs’ or ‘all’; “loga” with value “log” if
the absolute function value shall be plotted in a logarithmic scale, and “dd” with
value ‘dd’ if the second derivative shall be plotted (default 1st derivative). “hx” are
the figure handle objects.
The Inverse of the Incomplete Gamma Functions
The computation of the inverse of the incomplete gamma functions is based
on a Newton-Raphson method. Numerical tests with refining complex grids to
obtain an optimized starting value failed. Therefore the starting value for the
Newton-Raphson algorithm is a complex normally distributed random value.
The advantage is that the computation becomes very quick. The disadvantage
is that in rare cases no result is found. In many cases this was based on a
vanishing or on an extremely large first derivative. Repeating the computation
or slightly changing the γ -value could lead to a result. The Newton-Raphson
computation stops either after 100 iterations or after convergence is reached.
Be z NR the computed Newton-Raphson value. From this value we compute
γ (z NR , a). If the relative difference of both the real and the imaginary part
of γ (z NR , a) to the original gamma-value is less than 10 −7 from the original
γ -value, the result is accepted, otherwise it is rejected. In case no converged
result was found, the Newton-Raphson algorithm will be repeated (maximum: 50times).
γ (z, a) is a many-valued function of z. The Newton-Raphson computation
stops if one solution is found. To obtain several solutions the computation
must be repeated several times. The function [z,info,protocol] =
invincgammaC(a,ergt,tail,zstart) computes the inverse incomplete
gamma function. “a” is the integrand value, “ergt” the value of the incomplete
gamma function. The optional input value “tail” determines the integral tail;
“u” for the upper tail
∞
z · · · all other character values for the lower tail
(default). “zstart” (optional) determines the start value in case the computation
should not start randomly. If no result is found, the computations will continue
with random values. The output-value “z” is the integrand value, “info” a
cell variable with some information about the accuracy of the computation,
and “protocol” a table with the values of each Newton-Raphson iteration
step.
1 Gamma Functions, Beta Functions, and Related
arguments “z,a” and the optional 3rd argument “lu” with values ’‘lower”, or “upper”
(“l”,“u”,“lo”,“up”) in dependence of the integral tail. The class properties are
res for the first derivative of the incomplete gamma function, resd2 for the
second derivative, info is the information about the integral tail, and ina, inz
the integral input values “a, z”. diincgammaC supports the same methods as
incgammaC and in addition its own surf-method. The syntax is [h1, h2, h3]
= surf(obj,ax,was,loga,dd), with “obj” the class object. All other input
variables are optional. “ax” allows either the input variable ‘z’ (default) or ‘a’ to
be selected as the plot axis; “was” what shall be plotted, the real or absolute etc.
function value, with values ‘real’, ‘imag’, ‘abs’ or ‘all’; “loga” with value “log” if
the absolute function value shall be plotted in a logarithmic scale, and “dd” with
value ‘dd’ if the second derivative shall be plotted (default 1st derivative). “hx” are
the figure handle objects.
The Inverse of the Incomplete Gamma Functions
The computation of the inverse of the incomplete gamma functions is based
on a Newton-Raphson method. Numerical tests with refining complex grids to
obtain an optimized starting value failed. Therefore the starting value for the
Newton-Raphson algorithm is a complex normally distributed random value.
The advantage is that the computation becomes very quick. The disadvantage
is that in rare cases no result is found. In many cases this was based on a
vanishing or on an extremely large first derivative. Repeating the computation
or slightly changing the γ -value could lead to a result. The Newton-Raphson
computation stops either after 100 iterations or after convergence is reached.
Be z NR the computed Newton-Raphson value. From this value we compute
γ (z NR , a). If the relative difference of both the real and the imaginary part
of γ (z NR , a) to the original gamma-value is less than 10 −7 from the original
γ -value, the result is accepted, otherwise it is rejected. In case no converged
result was found, the Newton-Raphson algorithm will be repeated (maximum: 50times).
γ (z, a) is a many-valued function of z. The Newton-Raphson computation
stops if one solution is found. To obtain several solutions the computation
must be repeated several times. The function [z,info,protocol] =
invincgammaC(a,ergt,tail,zstart) computes the inverse incomplete
gamma function. “a” is the integrand value, “ergt” the value of the incomplete
gamma function. The optional input value “tail” determines the integral tail;
“u” for the upper tail
∞
z · · · all other character values for the lower tail
(default). “zstart” (optional) determines the start value in case the computation
should not start randomly. If no result is found, the computations will continue
with random values. The output-value “z” is the integrand value, “info” a
cell variable with some information about the accuracy of the computation,
and “protocol” a table with the values of each Newton-Raphson iteration
step.
