gamma: Gamma Functions

Description Usage Arguments Details Value Examples

Description

The Gamma function, denoted by Γ(z), is defined by

Γ(z) = \int_0^{∞} t^{z-1} e^{-t} dt ,\qquad Re(z) > 0

and can be extended by analytic continuation for Re(z) ≤ 0.

The incomplete lower and upper Gamma functions are defined as

γ(s, x) = \int_0^x t^{s-1} e^{-t} dt, \qquad Γ(s, x) = \int_x^{∞} t^{s-1} e^{-t} dt

for Re(s) > 0 such that Γ(s) = γ(s, x) + Γ(s, x), and the normalized (lower) incomplete Gamma function is P(s, x) = \frac{γ(s)}{Γ(s)}.

Usage

1
2
3
4

Arguments

z

real or complex argument.

s,x

real arguments greater zero.

Details

The Gamma function can be calculated by its series expansion, or by an asymptotic expansion, known as Stirling's formula.

sp.gamma computes the Gamma function combining both approaches, and sp.lgamma computes the (natural) logarithm of the absolute value of Γ(z).

sp.gammainc computes the lower and upper incomplete Gamma function as well as the normalized lower incomplete Gamma function. These functions are here only computed for real numbers s, z > 0.

Value

Returns the result of the Gamma function (or its natural logarithm), while sp.gammainc returns a list with gin the lower, gim the upper and gip the normalized lower incomplete gamma function value.

Examples

1
2
3
4
5
    sp.gamma(1/4); sp.gamma(-1/4)   #  3.625609908221908  -4.90166680986071
    sp.gamma(1/3); sp.gamma(-1/3)   #  2.678938534707748  -4.06235381827920
    sp.gamma(1/2); sp.gamma(-1/2)   #  1.772453850905516  -3.54490770181103
    sp.gamma(2/3); sp.gamma(-2/3)   #  1.354117939426400  -4.01840780206162
    sp.gamma(3/4); sp.gamma(-3/4)   #  1.225416702465178  -4.83414654429588

specfun documentation built on May 2, 2019, 4:44 p.m.

Related to gamma in specfun...