Normalized Gaussian curves with
expected value μ and
variance σ^{2}. The corresponding parameters are
a = \tfrac{1}{\sigma\sqrt{2\pi}},
b = μ, and
c = σ.
In mathematics, a Gaussian function, often simply referred to as a Gaussian, is a function of the form:

f\left(x\right) = a \exp{\left( { \frac{(xb)^2 }{ 2 c^2} } \right)}
for arbitrary real constants a, b and c. It is named after the mathematician Carl Friedrich Gauss.
The graph of a Gaussian is a characteristic symmetric "bell curve" shape. The parameter a is the height of the curve's peak, b is the position of the center of the peak and c (the standard deviation, sometimes called the Gaussian RMS width) controls the width of the "bell".
Gaussian functions are widely used in statistics where they describe the normal distributions, in signal processing where they serve to define Gaussian filters, in image processing where twodimensional Gaussians are used for Gaussian blurs, and in mathematics where they are used to solve heat equations and diffusion equations and to define the Weierstrass transform.
Contents

Properties 1

Integral of a Gaussian function 2

Twodimensional Gaussian function 3

Meaning of parameters for the general equation 3.1

Multidimensional Gaussian function 4

Gaussian profile estimation 5

Discrete Gaussian 6

Applications 7

See also 8

References 9

External links 10
Properties
Gaussian functions arise by composing the exponential function with a concave quadratic function. The Gaussian functions are thus those functions whose logarithm is a concave quadratic function.
The parameter c is related to the full width at half maximum (FWHM) of the peak according to

\mathrm{FWHM} = 2 \sqrt{2 \ln 2}\ c \approx 2.35482 c.^{[1]}
Alternatively, the parameter c can be interpreted by saying that the two inflection points of the function occur at x = b − c and x = b + c.
The full width at tenth of maximum (FWTM) for a Gaussian could be of interest and is

\mathrm{FWTM} = 2 \sqrt{2 \ln 10}\ c \approx 4.29193 c.^{[2]}
Gaussian functions are analytic, and their limit as x → ∞ is 0 (for the above case of b = 0).
Gaussian functions are among those functions that are elementary but lack elementary antiderivatives; the integral of the Gaussian function is the error function. Nonetheless their improper integrals over the whole real line can be evaluated exactly, using the Gaussian integral

\int_{\infty}^\infty e^{x^2}\,dx=\sqrt{\pi}
and one obtains

\int_{\infty}^\infty a e^{ { (xb)^2 \over 2 c^2 } }\,dx=ac\cdot\sqrt{2\pi}.
This integral is 1 if and only if a = \tfrac{1}{c\sqrt{2\pi}}, and in this case the Gaussian is the probability density function of a normally distributed random variable with expected value μ = b and variance σ^{2} = c^{2}:

g(x) = \frac{1}{\sigma\sqrt{2\pi}} e^{ \frac{1}{2}\left(\frac{x\mu}{\sigma}\right)^2 }.
These Gaussians are plotted in the accompanying figure.
Gaussian functions centered at zero minimize the Fourier uncertainty principle.
The product of two Gaussian functions is a Gaussian, and the convolution of two Gaussian functions is also a Gaussian, with variance being the sum of the original variances: c^2 = c_{1}^2 + c_{2}^2. The product of two Gaussian probability density functions, though, is not in general a Gaussian PDF.
Taking the Fourier transform (unitary, angular frequency convention) of a Gaussian function with parameters a = 1, b = 0 and c yields another Gaussian function, with parameters \sqrt{2\pi}ac, b = 0 and \frac{1}{2 \pi c}.^{[3]} So in particular the Gaussian functions with b = 0 and c = \frac{1}{\sqrt{2 \pi}} are kept fixed by the Fourier transform (they are eigenfunctions of the Fourier transform with eigenvalue 1). A physical realization is that of the diffraction pattern: for example, a photographic slide whose transmissivity has a Gaussian variation is also a Gaussian function. The fact that the Gaussian function is an eigenfunction of the continuous Fourier transform allows us to derive the following interesting identity from the Poisson summation formula:

\sum_{k\in\mathbb{Z}}\exp\left(\pi\cdot\left(\frac{k}{c}\right)^2\right) = c\cdot\sum_{k\in\mathbb{Z}}\exp(\pi\cdot(kc)^2).
Integral of a Gaussian function
The integral of an arbitrary Gaussian function is

\int_{\infty}^{\infty} a\,e^{\left( xb \right)^2/2c^2}\,dx=\sqrt{2} a \, \left\vert c \right\vert \, \sqrt{\pi}.
An alternative form is

\int_{\infty}^{\infty}k\,e^{f x^2 + g x + h}\,dx=\int_{\infty}^{\infty}k\,e^{f \left( xg/\left( 2f \right)\right)^2 +g^2/\left( 4f \right) + h}\,dx=k\,\sqrt{\frac{\pi}{f}}\,\exp\left(\frac{g^2}{4f} + h\right),
where f must be strictly positive for the integral to converge.
Proof
The integral

\int_{\infty}^{\infty} ae^{(xb)^2/2c^2}\,dx
for some real constants a, b, c > 0 can be calculated by putting it into the form of a Gaussian integral. First, the constant a can simply be factored out of the integral. Next, the variable of integration is changed from x to y = x  b.

a\int_{\infty}^\infty e^{y^2/2c^2}\,dy,
and then to z=y/\sqrt{2}c

\sqrt{2} a c \int_{\infty}^\infty e^{z^2}\,dz.
Then, using the Gaussian integral identity

\int_{\infty}^\infty e^{z^2}\,dz = \sqrt{\pi},
we have

\int_{\infty}^{\infty} ae^{(xb)^2/2c^2}\,dx=\sqrt{2}a c \sqrt{\pi}.
Twodimensional Gaussian function
Gaussian curve with a 2dimensional domain
In two dimensions, the power to which e is raised in the Gaussian function is any negativedefinite quadratic form. Consequently, the level sets of the Gaussian will always be ellipses.
A particular example of a twodimensional Gaussian function is

f(x,y) = A \exp\left( \left(\frac{(xx_o)^2}{2\sigma_x^2} + \frac{(yy_o)^2}{2\sigma_y^2} \right)\right).
Here the coefficient A is the amplitude, x_{o},y_{o} is the center and σ_{x}, σ_{y} are the x and y spreads of the blob. The figure on the right was created using A = 1, x_{o} = 0, y_{o} = 0, σ_{x} = σ_{y} = 1.
The volume under the Gaussian function is given by

V = \int_{\infty}^\infty \int_{\infty}^\infty f(x,y)\,dx dy=2 \pi A \sigma_x \sigma_y.
In general, a twodimensional elliptical Gaussian function is expressed as

f(x,y) = A \exp\left( \left(a(x  x_o)^2  2b(xx_o)(yy_o) + c(yy_o)^2 \right)\right)
where the matrix

\left[\begin{matrix} a & b \\ b & c \end{matrix}\right]
is positivedefinite.
Using this formulation, the figure on the right can be created using A = 1, (x_{o}, y_{o}) = (0, 0), a = c = 1/2, b = 0.
Meaning of parameters for the general equation
For the general form of the equation the coefficient A is the height of the peak and (x_{o}, y_{o}) is the center of the blob.
If we set

a = \frac{\cos^2\theta}{2\sigma_x^2} + \frac{\sin^2\theta}{2\sigma_y^2}

b = \frac{\sin2\theta}{4\sigma_x^2} + \frac{\sin2\theta}{4\sigma_y^2}

c = \frac{\sin^2\theta}{2\sigma_x^2} + \frac{\cos^2\theta}{2\sigma_y^2}
then we rotate the blob by a clockwise angle \theta (for counterclockwise rotation invert the signs in the b coefficient). This can be seen in the following examples:
\theta = 0

\theta = \pi/6

\theta = \pi/3

Using the following Octave code one can easily see the effect of changing the parameters
A = 1;
x0 = 0; y0 = 0;
sigma_x = 1;
sigma_y = 2;
[X, Y] = meshgrid(5:.1:5, 5:.1:5);
for theta = 0:pi/100:pi
a = cos(theta)^2/2/sigma_x^2 + sin(theta)^2/2/sigma_y^2;
b = sin(2*theta)/4/sigma_x^2 + sin(2*theta)/4/sigma_y^2 ;
c = sin(theta)^2/2/sigma_x^2 + cos(theta)^2/2/sigma_y^2;
Z = A*exp(  (a*(Xx0).^2 + 2*b*(Xx0).*(Yy0) + c*(Yy0).^2)) ;
end
surf(X,Y,Z);shading interp;view(36,36)
Such functions are often used in image processing and in computational models of visual system function—see the articles on scale space and affine shn.
Also see multivariate normal distribution.
Multidimensional Gaussian function
In an ndimensional space a Gaussian function can be defined as

f(x) = \exp(x^TAx) \;,
where x=\{x_1,\dots,x_n\} is a column of n coordinates, A is a positivedefinite n\times n matrix, and {}^T denotes transposition.
The integral of this Gaussian function over the whole ndimensional space is given as

\int_{\mathbb{R}^n} \exp(x^TAx) \, dx = \sqrt{\frac{\pi^n}{\det{A}}} \;.
It can be easily calculated by diagonalizing the matrix A and changing the integration variables to the eigenvectors of A.
More generally a shifted Gaussian function is defined as

f(x) = \exp(x^TAx+s^Tx) \;,
where s=\{s_1,\dots,s_n\} is the shift vector and the matrix A can be assumed to be symmetric, A^T=A, and positivedefinite. The following integrals with this function can be calculated with the same technique,

\int_{\mathbb{R}^n} e^{x^T A x+v^Tx} \, dx = \sqrt{\frac{\pi^n}{\det{A}}} \exp(\frac{1}{4}v^T A^{1}v)\equiv \mathcal{M}\;.

\int_{\mathbb{R}^n} e^{ x^T A x + v^T x} \left( a^T x \right) \, dx = (a^T u) \cdot \mathcal{M}\;,\; {\rm where}\; u = \frac{1}{2} A^{ 1} v \;.

\int_{\mathbb{R}^n} e^{ x^T A x + v^T x} \left( x^T D x \right) \, dx = \left( u^T D u + \frac{1}{2} {\rm tr} (D A^{ 1}) \right) \cdot \mathcal{M}\;.

\begin{align} & \int_{\mathbb{R}^n} e^{ x^T A' x + s'^T x} \left(  \frac{\partial}{\partial x} \Lambda \frac{\partial}{\partial x} \right) e^{ x^T A x + s^T x} \, dx = \\ & = \left( 2 {\rm tr} (A' \Lambda A B^{ 1}) + 4 u^T A' \Lambda A u  2 u^T (A' \Lambda s + A \Lambda s') + s'^T \Lambda s \right) \cdot \mathcal{M}\;, \\ & {\rm where} \; u = \frac{1}{2} B^{ 1} v, v = s + s', B = A + A' \;. \end{align}
Gaussian profile estimation
A number of fields such as stellar photometry, Gaussian beam characterization, and emission/absorption line spectroscopy work with sampled Gaussian functions and need to accurately estimate the height, position, and width parameters of the function. These are a, b, and c for a 1D Gaussian function, A, (x_0,y_0), and (\sigma_x,\sigma_y) for a 2D Gaussian function. The most common method for estimating the profile parameters is to take the logarithm of the data and fit a parabola to the resulting data set.^{[4]} While this provides a simple least squares fitting procedure, the resulting algorithm is biased by excessively weighting small data values, and this can produce large errors in the profile estimate. One can partially compensate for this through weighted least squares estimation, in which the small data values are given small weights, but this too can be biased by allowing the tail of the Gaussian to dominate the fit. In order to remove the bias, one can instead use an iterative procedure in which the weights are updated at each iteration (see Iteratively reweighted least squares).^{[4]}
Once one has an algorithm for estimating the Gaussian function parameters, it is also important to know how accurate those estimates are. While an estimation algorithm can provide numerical estimates for the variance of each parameter (i.e. the variance of the estimated height, position, and width of the function), one can use Cramér–Rao bound theory to obtain an analytical expression for the lower bound on the parameter variances, given some assumptions about the data.^{[5]}^{[6]}

The noise in the measured profile is either i.i.d. Gaussian, or the noise is Poissondistributed.

The spacing between each sampling (i.e. the distance between pixels measuring the data) is uniform.

The peak is "wellsampled", so that less than 10% of the area or volume under the peak (area if a 1D Gaussian, volume if a 2D Gaussian) lies outside the measurement region.

The width of the peak is much larger than the distance between sample locations (i.e. the detector pixels must be at least 5 times smaller than the Gaussian FWHM).
When these assumptions are satisfied, the following covariance matrix K applies for the 1D profile parameters a, b, and c under i.i.d. Gaussian noise and under Poisson noise:^{[5]}

\mathbf{K}_{\text{Gauss}} = \frac{\sigma^2}{\sqrt{\pi} \delta_x Q^2} \begin{pmatrix} \frac{3}{2c} &0 &\frac{1}{a} \\ 0 &\frac{2c}{a^2} &0 \\ \frac{1}{a} &0 &\frac{2c}{a^2} \end{pmatrix} \ , \qquad \mathbf{K}_{\text{Poiss}} = \frac{1}{\sqrt{2 \pi}} \begin{pmatrix} \frac{3a}{2c} &0 &\frac{1}{2} \\ 0 &\frac{c}{a} &0 \\ \frac{1}{2} &0 &\frac{c}{2a} \end{pmatrix} \ ,
where \delta_x is the width of the pixels used to sample the function, Q is the quantum efficiency of the detector, and \sigma indicates the standard deviation of the measurement noise. Thus, the individual variances for the parameters are, in the Gaussian noise case,

\begin{align} \text{var} (a) &= \frac{3 \sigma^2}{2 \sqrt{\pi} \, \delta_x Q^2 c} \\ \text{var} (b) &= \frac{2 \sigma^2 c}{\delta_x \sqrt{\pi} \, Q^2 a^2} \\ \text{var} (c) &= \frac{2 \sigma^2 c}{\delta_x \sqrt{\pi} \, Q^2 a^2} \end{align}
and in the Poisson noise case,

\begin{align} \text{var} (a) &= \frac{3a}{2 \sqrt{2 \pi} \, c} \\ \text{var} (b) &= \frac{c}{\sqrt{2 \pi} \, a} \\ \text{var} (c) &= \frac{c}{2 \sqrt{2 \pi} \, a}. \end{align} \
For the 2D profile parameters giving the amplitude A, position (x_0,y_0), and width (\sigma_x,\sigma_y) of the profile, the following covariance matrices apply:^{[6]}

\mathbf{K}_{\text{Gauss}} = \frac{\sigma^2}{\pi \delta_x \delta_y Q^2} \begin{pmatrix} \frac{2}{\sigma_x \sigma_y} &0 &0 &\frac{1}{A \sigma_y} &\frac{1}{A \sigma_x} \\ 0 &\frac{2 \sigma_x}{A^2 \sigma_y} &0 &0 &0 \\ 0 &0 &\frac{2 \sigma_y}{A^2 \sigma_x} &0 &0 \\ \frac{1}{A \sigma_y} &0 &0 &\frac{2 \sigma_x}{A^2 \sigma_y} &0 \\ \frac{1}{A \sigma_x} &0 &0 &0 &\frac{2 \sigma_y}{A^2 \sigma_x} \end{pmatrix} \ ,

\qquad \mathbf{K}_{\text{Poiss}} = \frac{1}{2 \pi} \begin{pmatrix} \frac{3A}{\sigma_x \sigma_y} &0 &0 &\frac{1}{\sigma_y} &\frac{1}{\sigma_x} \\ 0 &\frac{\sigma_x}{A \sigma_y} &0 &0 &0 \\ 0 &0 &\frac{\sigma_y}{A \sigma_x} &0 &0 \\ \frac{1}{\sigma_y} &0 &0 &\frac{2 \sigma_x}{3A \sigma_y} &\frac{1}{3A} \\ \frac{1}{\sigma_x} &0 &0 &\frac{1}{3A} &\frac{2 \sigma_y}{3A \sigma_x} \end{pmatrix} \ .
where the individual parameter variances are given by the diagonal elements of the covariance matrix.
Discrete Gaussian
One may ask for a discrete analog to the Gaussian; this is necessary in discrete applications, particularly digital signal processing. A simple answer is to sample the continuous Gaussian, yielding the sampled Gaussian kernel. However, this discrete function does not have the discrete analogs of the properties of the continuous function, and can lead to undesired effects, as described in the article scale space implementation.
An alternative approach is to use discrete Gaussian kernel:^{[7]}

T(n, t) = e^{t} I_n(t)\,
where I_n(t) denotes the modified Bessel functions of integer order.
This is the discrete analog of the continuous Gaussian in that it is the solution to the discrete diffusion equation (discrete space, continuous time), just as the continuous Gaussian is the solution to the continuous diffusion equation.^{[8]}
Applications
Gaussian functions appear in many contexts in the natural sciences, the social sciences, mathematics, and engineering. Some examples include:

In statistics and probability theory, Gaussian functions appear as the density function of the normal distribution, which is a limiting probability distribution of complicated sums, according to the central limit theorem.

Gaussian functions are the Green's function for the (homogeneous and isotropic) diffusion equation (and to the heat equation, which is the same thing), a partial differential equation that describes the time evolution of a massdensity under diffusion. Specifically, if the massdensity at time t=0 is given by a Dirac delta, which essentially means that the mass is initially concentrated in a single point, then the massdistribution at time t will be given by a Gaussian function, with the parameter a being linearly related to 1/√t and c being linearly related to √t. More generally, if the initial massdensity is φ(x), then the massdensity at later times is obtained by taking the convolution of φ with a Gaussian function. The convolution of a function with a Gaussian is also known as a Weierstrass transform.

A Gaussian function is the wave function of the ground state of the quantum harmonic oscillator.

The molecular orbitals used in computational chemistry can be linear combinations of Gaussian functions called Gaussian orbitals (see also basis set (chemistry)).

Mathematically, the derivatives of the Gaussian function can be represented using Hermite functions. The nth derivative of the Gaussian is the Gaussian function itself multiplied by the nth Hermite polynomial, up to scale.

Consequently, Gaussian functions are also associated with the vacuum state in quantum field theory.

Gaussian beams are used in optical and microwave systems.

In scale space representation, Gaussian functions are used as smoothing kernels for generating multiscale representations in computer vision and image processing. Specifically, derivatives of Gaussians (Hermite functions) are used as a basis for defining a large number of types of visual operations.

Gaussian functions are used to define some types of artificial neural networks.

In fluorescence microscopy a 2D Gaussian function is used to approximate the Airy disk, describing the intensity distribution produced by a point source.

In signal processing they serve to define Gaussian filters, such as in image processing where 2D Gaussians are used for Gaussian blurs. In digital signal processing, one uses a discrete Gaussian kernel, which may be defined by sampling a Gaussian, or in a different way.

In geostatistics they have been used for understanding the variability between the patterns of a complex training image. They are used with kernel methods to cluster the patterns in the feature space.^{[9]}
See also
References

^ Using the logarithmic identity \log \left( x \right) = \log \left( \frac{1}{x} \right), this expression can be transformed to \mathrm{FWHM} = 2 \sqrt{2 \ln 0.5}\ c.

^ Using the logarithmic identity \log \left( x \right) = \log \left( \frac{1}{x} \right), this expression can be transformed to \mathrm{FWTM} = 2 \sqrt{2 \ln 0.1}\ c.

^ Weisstein, Eric W. "Fourier Transform – Gaussian".

^ ^{a} ^{b} Hongwei Guo, "A simple algorithm for fitting a Gaussian function," IEEE Sign. Proc. Mag. 28(9): 134137 (2011).

^ ^{a} ^{b} N. Hagen, M. Kupinski, and E. L. Dereniak, "Gaussian profile estimation in one dimension," Appl. Opt. 46:53745383 (2007)

^ ^{a} ^{b} N. Hagen and E. L. Dereniak, "Gaussian profile estimation in two dimensions," Appl. Opt. 47:68426851 (2008)

^ Lindeberg, T., "Scalespace for discrete signals," PAMI(12), No. 3, March 1990, pp. 234254.

^ Campbell, J, 2007, The SMM model as a boundary value problem using the discrete diffusion equation, Theor Popul Biol. 2007 Dec;72(4):53946.

^ Honarkhah, M and Caers, J, 2010, Stochastic Simulation of Patterns Using DistanceBased Pattern Modeling, Mathematical Geosciences, 42: 487  517
External links

Mathworld, includes a proof for the relations between c and FWHM

JavaScript to create Gaussian convolution kernels

"Integrating The Bell Curve" at MathPages.com.

Haskell, Erlang and Perl implementation of Gaussian distribution

Bensimhoun Michael, NDimensional Cumulative Function, And Other Useful Facts About Gaussians and Normal Densities (2009)
This article was sourced from Creative Commons AttributionShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and USA.gov, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for USA.gov and content contributors is made possible from the U.S. Congress, EGovernment Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a nonprofit organization.