Gaussian function

Short description: Mathematical function

In mathematics, a Gaussian function, often simply referred to as a Gaussian, is a function of the base form f(x)=exp⁡(−x2) and with parametric extension f(x)=aexp⁡(−(x−b)22c2) for arbitrary real constants a, b and non-zero 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 often used to represent the probability density function of a normally distributed random variable with expected value μ = b and variance σ2 = c2. In this case, the Gaussian is of the form[1]

g(x)=1σ2πexp⁡(−12(x−μ)2σ2).

Gaussian functions are widely used in statistics to describe the normal distributions, in signal processing to define Gaussian filters, in image processing where two-dimensional Gaussians are used for Gaussian blurs, and in mathematics to solve heat equations and diffusion equations and to define the Weierstrass transform.

## Contents

* 1 Properties
* 2 Integral of a Gaussian function
* 2.1 Relation to standard Gaussian integral
* 3 Two-dimensional Gaussian function
* 3.1 Meaning of parameters for the general equation
* 3.2 Higher-order Gaussian or super-Gaussian function
* 4 Multi-dimensional Gaussian function
* 5 Estimation of parameters
* 5.1 Parameter precision
* 6 Discrete Gaussian
* 7 Applications
* 8 See also
* 9 References
* 10 External links

## Properties

Gaussian functions arise by composing the exponential function with a concave quadratic function: f(x)=exp⁡(αx2+βx+γ), where

* α=−1/2c2,
* β=b/c2,
* γ=ln⁡a−(b2/2c2).

(Note: in ln⁡a,a=1/(σ2π), not to be confused with α=−1/2c2,)

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

FWHM=22ln⁡2c≈2.35482c.

The function may then be expressed in terms of the FWHM, represented by w: f(x)=ae−4(ln⁡2)(x−b)2/w2.

Alternatively, the parameter c can be interpreted by saying that the two inflection points of the function occur at x = b ± c.

The full width at tenth of maximum (FWTM) for a Gaussian could be of interest and is FWTM=22ln⁡10c≈4.29193c.

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:

∫e−x2dx=π2erf⁡x+C.

Nonetheless, their improper integrals over the whole real line can be evaluated exactly, using the Gaussian integral ∫−∞∞e−x2dx=π, and one obtains ∫−∞∞ae−(x−b)2/(2c2)dx=ac⋅2π.

Normalized Gaussian curves with expected value μ and variance σ2. The corresponding parameters are a=1σ2π, b = μ and c = σ.

This integral is 1 if and only if a=1c2π (the normalizing constant), and in this case the Gaussian is the probability density function of a normally distributed random variable with expected value μ = b and variance σ2 = c2: g(x)=1σ2πexp⁡(−(x−μ)22σ2).

These Gaussians are plotted in the accompanying figure.

Gaussian functions centered at zero minimize the Fourier uncertainty principle[clarification needed].

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: c2=c12+c22. The product of two Gaussian probability density functions (PDFs), 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 c, b = 0 and 1/c.[2] So in particular the Gaussian functions with b = 0 and c=1 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 transmittance 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[clarification needed] identity from the Poisson summation formula: ∑k∈ℤexp⁡(−π⋅(kc)2)=c⋅∑k∈ℤexp⁡(−π⋅(kc)2).

## Integral of a Gaussian function

The integral of an arbitrary Gaussian function is ∫−∞∞ae−(x−b)2/2c2dx=2a|c|π.

An alternative form is ∫−∞∞ke−fx2+gx+hdx=∫−∞∞ke−f(x−g/(2f))2+g2/(4f)+hdx=kπfexp⁡(g24f+h), where f must be strictly positive for the integral to converge.

### Relation to standard Gaussian integral

The integral ∫−∞∞ae−(x−b)2/2c2dx 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∫−∞∞e−y2/2c2dy, and then to z=y/2c2: a2c2∫−∞∞e−z2dz.

Then, using the Gaussian integral identity ∫−∞∞e−z2dz=π,

we have ∫−∞∞ae−(x−b)2/2c2dx=a2πc2.

## Two-dimensional Gaussian function

3d plot of a Gaussian function with a two-dimensional domain

Base form: f(x,y)=exp⁡(−x2−y2)

In two dimensions, the power to which e is raised in the Gaussian function is any negative-definite quadratic form. Consequently, the level sets of the Gaussian will always be ellipses.

A particular example of a two-dimensional Gaussian function is f(x,y)=Aexp⁡(−((x−x0)22σX2+(y−y0)22σY2)).

Here the coefficient A is the amplitude, x0, y0 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, x0 = 0, y0 = 0, σx = σy = 1.

The volume under the Gaussian function is given by V=∫−∞∞∫−∞∞f(x,y)dxdy=2πAσXσY.

In general, a two-dimensional elliptical Gaussian function is expressed as f(x,y)=Aexp⁡(−(a(x−x0)2+2b(x−x0)(y−y0)+c(y−y0)2)), where the matrix [abbc] is positive-definite.

Using this formulation, the figure on the right can be created using A = 1, (x0, y0) = (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 (x0, y0) is the center of the blob.

If we seta=cos2θ2σX2+sin2θ2σY2,b=−sin⁡2θ4σX2+sin⁡2θ4σY2,c=sin2θ2σX2+cos2θ2σY2,then we rotate the blob by a positive, counter-clockwise angle θ (for negative, clockwise rotation, invert the signs in the b coefficient).[3]

To get back the coefficients θ, σX and σY from a, b and c use

θ=12arctan⁡(2ba−c),θ∈[−45,45],σX2=12(a⋅cos2θ+2b⋅cos⁡θsin⁡θ+c⋅sin2θ),σY2=12(a⋅sin2θ−2b⋅cos⁡θsin⁡θ+c⋅cos2θ).

Example rotations of Gaussian blobs can be seen in the following examples:

θ=0 | θ=−π/6 | θ=−π/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 * (X - x0).^2 + 2 * b * (X - x0) .* (Y - y0) + c * (Y - y0).^2));

surf(X, Y, Z);
shading interp;
view(-36, 36)
waitforbuttonpress
end

Such functions are often used in image processing and in computational models of visual system function—see the articles on scale space and affine shape adaptation.

Also see multivariate normal distribution.

### Higher-order Gaussian or super-Gaussian function

A more general formulation of a Gaussian function with a flat-top and Gaussian fall-off can be taken by raising the content of the exponent to a power P: f(x)=Aexp⁡(−((x−x0)22σX2)P).

This function is known as a super-Gaussian function and is often used for Gaussian beam formulation.[4] This function may also be expressed in terms of the full width at half maximum (FWHM), represented by w: f(x)=Aexp⁡(−ln⁡2(4(x−x0)2w2)P).

In a two-dimensional formulation, a Gaussian function along x and y can be combined[5] with potentially different PX and PY to form a rectangular Gaussian distribution: f(x,y)=Aexp⁡(−((x−x0)22σX2)PX−((y−y0)22σY2)PY). or an elliptical Gaussian distribution: f(x,y)=Aexp⁡(−((x−x0)22σX2+(y−y0)22σY2)P)

## Multi-dimensional Gaussian function

Main article: Multivariate normal distribution

In an n-dimensional space a Gaussian function can be defined as f(x)=exp⁡(−xTCx), where x=[x1⋯xn] is a column of n coordinates, C is a positive-definite n×n matrix, and T denotes matrix transposition.

The integral of this Gaussian function over the whole n-dimensional space is given as ∫ℝnexp⁡(−xTCx)dx=πndet⁡C.

It can be easily calculated by diagonalizing the matrix C and changing the integration variables to the eigenvectors of C.

More generally a shifted Gaussian function is defined as f(x)=exp⁡(−xTCx+sTx), where s=[s1⋯sn] is the shift vector and the matrix C can be assumed to be symmetric, CT=C, and positive-definite. The following integrals with this function can be calculated with the same technique: ∫ℝne−xTCx+vTxdx=πndet⁡Cexp⁡(14vTC−1v)≡ℳ. ∫ℝne−xTCx+vTx(aTx)dx=(aTu)⋅ℳ, where u=12C−1v. ∫ℝne−xTCx+vTx(xTDx)dx=(uTDu+12tr⁡(DC−1))⋅ℳ. ∫ℝne−xTC′x+s'Tx(−∂∂xΛ∂∂x)e−xTCx+sTxdx=(2tr⁡(C′ΛCB−1)+4uTC′ΛCu−2uT(C′Λs+CΛs′)+s'TΛs)⋅ℳ, where u=12B−1v, v=s+s′, B=C+C′.

## Estimation of parameters

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. There are three unknown parameters for a 1D Gaussian function (a, b, c) and five for a 2D Gaussian function (A;x0,y0;σX,σY).

The most common method for estimating the Gaussian parameters is to take the logarithm of the data and fit a parabola to the resulting data set.[6][7] While this provides a simple curve fitting procedure, the resulting algorithm may be biased by excessively weighting small data values, which can produce large errors in the profile estimate. One can partially compensate for this problem through weighted least squares estimation, reducing the weight of small data values, 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 iteratively reweighted least squares procedure, in which the weights are updated at each iteration.[7] It is also possible to perform non-linear regression directly on the data, without involving the logarithmic data transformation; for more options, see probability distribution fitting.

### Parameter precision

Once one has an algorithm for estimating the Gaussian function parameters, it is also important to know how precise those estimates are. Any least squares 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 also use Cramér–Rao bound theory to obtain an analytical expression for the lower bound on the parameter variances, given certain assumptions about the data.[8][9]

1. The noise in the measured profile is either i.i.d. Gaussian, or the noise is Poisson-distributed.
2. The spacing between each sampling (i.e. the distance between pixels measuring the data) is uniform.
3. The peak is "well-sampled", 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.
4. 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:[8] 𝐊Gauss=σ2πδXQ2(32c0−1a02ca20−1a02ca2) ,𝐊Poiss=12π(3a2c0−120ca0−120c2a) , where δX is the width of the pixels used to sample the function, Q is the quantum efficiency of the detector, and σ indicates the standard deviation of the measurement noise. Thus, the individual variances for the parameters are, in the Gaussian noise case, var⁡(a)=3σ22πδXQ2cvar⁡(b)=2σ2cδXπQ2a2var⁡(c)=2σ2cδXπQ2a2

and in the Poisson noise case, var⁡(a)=3a22πcvar⁡(b)=c2πavar⁡(c)=c22πa.

For the 2D profile parameters giving the amplitude A, position (x0,y0), and width (σX,σY) of the profile, the following covariance matrices apply:[9]

𝐊Gauss=σ2πδXδYQ2(2σXσY00−1AσY−1AσX02σXA2σY000002σYA2σX00−1Aσy002σXA2σy0−1AσX0002σYA2σX)𝐊Poisson=12π(3AσXσY00−1σY−1σX0σXAσY00000σYAσX00−1σY002σX3AσY13A−1σX0013A2σY3AσX). where the individual parameter variances are given by the diagonal elements of the covariance matrix.

## Discrete Gaussian

The discrete Gaussian kernel (solid), compared with the sampled Gaussian kernel (dashed) for scales t=0.5,1,2,4.

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 the discrete Gaussian kernel:[10] T(n,t)=e−tIn(t) where In(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.[10][11]

## 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 mass-density under diffusion. Specifically, if the mass-density 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 mass-distribution 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; this time-varying Gaussian is described by the heat kernel. More generally, if the initial mass-density is φ(x), then the mass-density 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. For unit variance, the n-th derivative of the Gaussian is the Gaussian function itself multiplied by the n-th 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 systems, microwave systems and lasers.
* In scale space representation, Gaussian functions are used as smoothing kernels for generating multi-scale 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.[12]

## See also

* Normal distribution
* Cauchy distribution
* Radial basis function kernel

## References

1. ↑ Squires, G. L. (2001-08-30). Practical Physics (4 ed.). Cambridge University Press. doi:10.1017/cbo9781139164498. ISBN 978-0-521-77940-1. https://www.cambridge.org/core/product/identifier/9781139164498/type/book.
2. ↑ Weisstein, Eric W.. "Fourier Transform – Gaussian". MathWorld. http://mathworld.wolfram.com/FourierTransformGaussian.html.
3. ↑ Nawri, Nikolai. "Berechnung von Kovarianzellipsen". http://imkbemu.physik.uni-karlsruhe.de/~eisatlas/covariance_ellipses.pdf.
4. ↑ Parent, A., M. Morin, and P. Lavigne. "Propagation of super-Gaussian field distributions". Optical and Quantum Electronics 24.9 (1992): S1071–S1079.
5. ↑ "GLAD optical software commands manual, Entry on GAUSSIAN command". 2016-12-15. http://www.aor.com/anonymous/pub/commands.pdf.
6. ↑ Caruana, Richard A.; Searle, Roger B.; Heller, Thomas.; Shupack, Saul I. (1986). "Fast algorithm for the resolution of spectra". Analytical Chemistry (American Chemical Society (ACS)) 58 (6): 1162–1167. doi:10.1021/ac00297a041. ISSN 0003-2700.
7. ↑ 7.0 7.1 Hongwei Guo, "A simple algorithm for fitting a Gaussian function," IEEE Sign. Proc. Mag. 28(9): 134-137 (2011).
8. ↑ 8.0 8.1 N. Hagen, M. Kupinski, and E. L. Dereniak, "Gaussian profile estimation in one dimension," Appl. Opt. 46:5374–5383 (2007)
9. ↑ 9.0 9.1 N. Hagen and E. L. Dereniak, "Gaussian profile estimation in two dimensions," Appl. Opt. 47:6842–6851 (2008)
10. ↑ 10.0 10.1 Lindeberg, T., "Scale-space for discrete signals," PAMI(12), No. 3, March 1990, pp. 234–254.
11. ↑ Campbell, J, 2007, The SMM model as a boundary value problem using the discrete diffusion equation, Theor Popul Biol. 2007 Dec;72(4):539–46.
12. ↑ Honarkhah, M and Caers, J, 2010, Stochastic Simulation of Patterns Using Distance-Based Pattern Modeling, Mathematical Geosciences, 42: 487–517

## External links

* Mathworld, includes a proof for the relations between c and FWHM
* "Integrating The Bell Curve". MathPages.com. http://www.mathpages.com/home/kmath045/kmath045.htm.
* Haskell, Erlang and Perl implementation of Gaussian distribution
* Bensimhoun Michael, N-Dimensional Cumulative Function, And Other Useful Facts About Gaussians and Normal Densities (2009)
* Code for fitting Gaussians in ImageJ and Fiji.

0.00

(0 votes)

Original source: https://en.wikipedia.org/wiki/Gaussian function. Read more

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Gaussian_function&oldid=177807"