Key functions

Navigation:  Key functions and expressions >

Key functions

Previous pageReturn to chapter overviewNext page

In this section we provide basic details of a number of functions that arise in several separate topics in statistics. The include Bessel functions, the Exponential integral function, the Gamma and Beta functions, the Gompertz curve, Stirling's approximation for n! when n is large, and the Logistic function.

Bessel functions

Bessel functions occur as the solution to specific differential equations. They are described with reference to a parameter known as the order, n, shown as a subscript. Bessel functions are widely used in engineering applications, but do arise in statistical analysis, particularly in the context of problems involving directional data in two or three dimensions (Bessel functions of the first kind). Bessel functions of the second kind do also arise in statistical analysis, but only rarely.

Mathematical software packages such as MATLab and Mathematica provide support for a full range of Bessel functions, as do "R" and perhaps surprisingly, Excel (usage requires the Analysis ToolPak addin). In all cases the functions are of the form besselT(x,n) where T is the type of Bessel function, typically I or J, x is the point at which the function is evaluated, and n is the order parameter, as described in the section below.

Bessel functions of the first kind

For integer orders Bessel functions can be represented as an infinite series. Order 0 and Order 1 expansions for standard Bessel functions of the first kind are shown below, together with the general expression in terms of the Gamma function. Graphs of Bessel functions of this type are similar to a dampening sine wave, as shown in the diagram below.

and more generally, for all real n≥0 (not necessarily integer):

Bessel function of the first kind, Jn(x). Graph of integer parameter values


The modified Bessel function of the first kind has a very similar expansion for real values of n, and is given by the general expression:

Usage in statistical analysis arises in connection with the von Mises distribution, which is used in directional statistics, and Bessel functions are also used in connection with some forms of spline curve fitting. The graph of this modified form of the function does not oscillate, as the term involving (-1) in the previous expansion is omitted. Graphs of the function for the same set of parameters as above are provided below:

Modified Bessel function of the first kind, In(x). Graph of integer parameter values


Exponential integral function

The exponential integral function is one of a family of such functions, related to the Incomplete Gamma function, and is used in association with spline curve fitting. See the Mathworld website entry for more details. The integral for the case n=1 is defined as:

and more generally as

Gamma integral function, Γ

The Gamma function, Γ, is a widely used definite integral function and the generalization of factorials to non-integer cases. The standard form of the integral, for real-valued x, is:

For integer values of x: Γ(x)=(x‑1)! and more generally Γ(x+1)=xΓ(x). From these results we have, for example, Γ(3/2)=Γ(1/2)/2=(√π)/2.

A graph of the Gamma function for a range of real x-values is shown below. The Gamma function, as opposed to the Gamma distribution, is not generally provided in integrated statistical packages, but this varies (it is available in SPSS, for example). For mathematical suites, like MATLab and Mathematica, it is a standard function, but in all cases it is recommended that the natural logarithm of the function is evaluated for larger values of x, as overflow is a common problem. See the Mathworld website entry for more details.

Gamma function, real values


Beta function

The Beta function is closely related to the Gamma function and is used in the Beta distribution. It is the ratio:

It can be expressed as an integral over the interval [0.1] by the formula:

Gompertz function

The Gompertz curve is very similar to the Logistic curve in form (see below), in that it is a constrained S-shaped growth function, used in a number of growth models and time series applications. The function is defined as:

Taking natural logs, this may be written as:

The parameter a is the upper limit or asymptote of the curve - in the chart shown below we have set a=1; parameters b and c control the form of the curve. The parameter b dictates where (between 0 and a) the curve crosses through 0 on the x-axis/time axis. With smaller values it crosses closer to a; the parameter c defines the shape of the curve - in the examples below, the red curve is for c=-1, and the cyan curve (almost a straight line) is for c=-0.1.

Gompertz curves


An alternative form of the Gompertz function, with essentially the same form, is:

Logistic function

The logistic function is a very simple, S-shaped curve, used originally to describe the growth of population over time under resource constraints. The function is widely used in statistics as the basis for the logit transform and in connection with logistic regression and the logistic probability density functions.

A graph of this function (the standard form) is shown below. A version of the logistic that includes shape parameters, similar to those of the Gompertz function, is:

Logistic curve, standard form

Stirling's Approximation

Stirling's formula provides a useful approximation for n! when n is large. The usual (most accurate) formulation for n>0 is:

This formula is accurate to within 1% for n>7, with rapid convergence for larger n. Note that if natural logarithms are taken of both sides this formula reduces to:

hence a rough approximation to n! is:

This approximation was derived by Sterling following the work of De Moivre on the Normal approximation to the Binomial distribution, described elsewhere in this Handbook. De Moivre produced the formula:

whereas the initial constant should be 2.5066...(see Pearson, 1924 [PEA1] for a discussion of the history of this approximation and its relation to the Normal distribution).


[ABR1] Abramowitz M, Stegun I A, eds.(1972) Handbook of Mathematical Functions With Formulas, Graphs, and Mathematical Tables. 10th printing, US National Bureau of Standards, Applied Mathematics Series - 55

[PEA1] Pearson K (1924) Historical note on the origin of the normal curve of errors. Biometrika, 16(4), 402–404

Mathworld: Bessel and Modified Bessel function of the first kind: and ; Exponential Integral: ; Gamma function:

Wikipedia: Bessel functions: ; Exponential integral: