Gaussian function

Last updated

In mathematics, a Gaussian function, often simply referred to as a Gaussian, is a function of the base form

Contents

and with parametric extension

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]

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.

Properties

Gaussian functions arise by composing the exponential function with a concave quadratic function:

where

(Note: in , not to be confused with )

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

The function may then be expressed in terms of the FWHM, represented by w:

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

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

and one obtains

Normalized Gaussian curves with expected value m and variance s. The corresponding parameters are
a
=
1
s
2
p
{\textstyle a={\tfrac {1}{\sigma {\sqrt {2\pi }}}}}
, b = m and c = s. Normal Distribution PDF.svg
Normalized Gaussian curves with expected value μ and variance σ. The corresponding parameters are , b = μ and c = σ.

This integral is 1 if and only if (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:

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: . 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 , b = 0 and . [2] So in particular the Gaussian functions with b = 0 and 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:

Integral of a Gaussian function

The integral of an arbitrary Gaussian function is

An alternative form is

where f must be strictly positive for the integral to converge.

Relation to standard Gaussian integral

The integral

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 = xb:

and then to :

Then, using the Gaussian integral identity

we have

Two-dimensional Gaussian function

3d plot of a Gaussian function with a two-dimensional domain Gaussian 2d surface.png
3d plot of a Gaussian function with a two-dimensional domain

Base form:

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

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

In general, a two-dimensional elliptical Gaussian function is expressed as

where the matrix

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 set

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 , and from , and use


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

th
=
0
{\displaystyle \theta =0} Gaussian 2d 0 degrees.png
th
=
-
p
/
6
{\displaystyle \theta =-\pi /6} Gaussian 2d 30 degrees.png
th
=
-
p
/
3
{\displaystyle \theta =-\pi /3} Gaussian 2d 60 degrees.png

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);fortheta=0:pi/100:pia=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);shadinginterp;view(-36,36)waitforbuttonpressend

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 :

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:

In a two-dimensional formulation, a Gaussian function along and can be combined [5] with potentially different and to form a rectangular Gaussian distribution:

or an elliptical Gaussian distribution:

Multi-dimensional Gaussian function

In an -dimensional space a Gaussian function can be defined as

where is a column of coordinates, is a positive-definite matrix, and denotes matrix transposition.

The integral of this Gaussian function over the whole -dimensional space is given as

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

More generally a shifted Gaussian function is defined as

where is the shift vector and the matrix can be assumed to be symmetric, , and positive-definite. The following integrals with this function can be calculated with the same technique:

where

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 .

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 , , and under i.i.d. Gaussian noise and under Poisson noise: [8]

where is the width of the pixels used to sample the function, 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,

and in the Poisson noise case,

For the 2D profile parameters giving the amplitude , position , and width of the profile, the following covariance matrices apply: [9]

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.
{\displaystyle t=0.5,1,2,4.} Discrete Gaussian kernel.svg
The discrete Gaussian kernel (solid), compared with the sampled Gaussian kernel (dashed) for scales

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]

where 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:

See also

Related Research Articles

<span class="mw-page-title-main">Normal distribution</span> Probability distribution

In statistics, a normal distribution or Gaussian distribution is a type of continuous probability distribution for a real-valued random variable. The general form of its probability density function is

<span class="mw-page-title-main">Uncertainty principle</span> Foundational principle in quantum physics

The uncertainty principle, also known as Heisenberg's indeterminacy principle, is a fundamental concept in quantum mechanics. It states that there is a limit to the precision with which certain pairs of physical properties, such as position and momentum, can be simultaneously known. In other words, the more accurately one property is measured, the less accurately the other property can be known.

<span class="mw-page-title-main">Error function</span> Sigmoid shape special function

In mathematics, the error function, often denoted by erf, is a function defined as:

<span class="mw-page-title-main">Green's function</span> Impulse response of an inhomogeneous linear differential operator

In mathematics, a Green's function is the impulse response of an inhomogeneous linear differential operator defined on a domain with specified initial conditions or boundary conditions.

In probability and statistics, an exponential family is a parametric set of probability distributions of a certain form, specified below. This special form is chosen for mathematical convenience, including the enabling of the user to calculate expectations, covariances using differentiation based on some useful algebraic properties, as well as for generality, as exponential families are in a sense very natural sets of distributions to consider. The term exponential class is sometimes used in place of "exponential family", or the older term Koopman–Darmois family. Sometimes loosely referred to as "the" exponential family, this class of distributions is distinct because they all possess a variety of desirable properties, most importantly the existence of a sufficient statistic.

<span class="mw-page-title-main">Dawson function</span> Mathematical function

In mathematics, the Dawson function or Dawson integral (named after H. G. Dawson) is the one-sided Fourier–Laplace sine transform of the Gaussian function.

<span class="mw-page-title-main">Gaussian integral</span> Integral of the Gaussian function, equal to sqrt(π)

The Gaussian integral, also known as the Euler–Poisson integral, is the integral of the Gaussian function over the entire real line. Named after the German mathematician Carl Friedrich Gauss, the integral is

In mathematics, Laplace's method, named after Pierre-Simon Laplace, is a technique used to approximate integrals of the form

<span class="mw-page-title-main">Voigt profile</span> Probability distribution

The Voigt profile is a probability distribution given by a convolution of a Cauchy-Lorentz distribution and a Gaussian distribution. It is often used in analyzing data from spectroscopy or diffraction.

<span class="mw-page-title-main">Rice distribution</span> Probability distribution

In probability theory, the Rice distribution or Rician distribution is the probability distribution of the magnitude of a circularly-symmetric bivariate normal random variable, possibly with non-zero mean (noncentral). It was named after Stephen O. Rice (1907–1986).

In probability theory, calculation of the sum of normally distributed random variables is an instance of the arithmetic of random variables.

A ratio distribution is a probability distribution constructed as the distribution of the ratio of random variables having two other known distributions. Given two random variables X and Y, the distribution of the random variable Z that is formed as the ratio Z = X/Y is a ratio distribution.

<span class="mw-page-title-main">Q-function</span> Statistics function

In statistics, the Q-function is the tail distribution function of the standard normal distribution. In other words, is the probability that a normal (Gaussian) random variable will obtain a value larger than standard deviations. Equivalently, is the probability that a standard normal random variable takes a value larger than .

<span class="mw-page-title-main">Half-normal distribution</span> Probability distribution

In probability theory and statistics, the half-normal distribution is a special case of the folded normal distribution.

<span class="mw-page-title-main">Normal-inverse-gamma distribution</span>

In probability theory and statistics, the normal-inverse-gamma distribution is a four-parameter family of multivariate continuous probability distributions. It is the conjugate prior of a normal distribution with unknown mean and variance.

<span class="mw-page-title-main">Gauss–Hermite quadrature</span> Form of Gaussian quadrature

In numerical analysis, Gauss–Hermite quadrature is a form of Gaussian quadrature for approximating the value of integrals of the following kind:

Common integrals in quantum field theory are all variations and generalizations of Gaussian integrals to the complex plane and to multiple dimensions. Other integrals can be approximated by versions of the Gaussian integral. Fourier integrals are also considered.

A product distribution is a probability distribution constructed as the distribution of the product of random variables having two other known distributions. Given two statistically independent random variables X and Y, the distribution of the random variable Z that is formed as the product is a product distribution.

In machine learning, diffusion models, also known as diffusion probabilistic models or score-based generative models, are a class of latent variable generative models. A diffusion model consists of three major components: the forward process, the reverse process, and the sampling procedure. The goal of diffusion models is to learn a diffusion process that generates a probability distribution for a given dataset from which we can then sample new images. They learn the latent structure of a dataset by modeling the way in which data points diffuse through their latent space.

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.
  2. Weisstein, Eric W. "Fourier Transform – Gaussian". MathWorld . Retrieved 19 December 2013.
  3. Nawri, Nikolai. "Berechnung von Kovarianzellipsen" (PDF). Archived from the original (PDF) on 2019-08-14. Retrieved 14 August 2019.
  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" (PDF). Applied Optics Research. 2016-12-15.
  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. 1 2 Hongwei Guo, "A simple algorithm for fitting a Gaussian function," IEEE Sign. Proc. Mag. 28(9): 134-137 (2011).
  8. 1 2 N. Hagen, M. Kupinski, and E. L. Dereniak, "Gaussian profile estimation in one dimension," Appl. Opt. 46:5374–5383 (2007)
  9. 1 2 N. Hagen and E. L. Dereniak, "Gaussian profile estimation in two dimensions," Appl. Opt. 47:6842–6851 (2008)
  10. 1 2 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. Haddad, R.A. and Akansu, A.N., 1991, A Class of Fast Gaussian Binomial Filters for Speech and Image processing , IEEE Trans. on Signal Processing, 39-3: 723–727
  13. Honarkhah, M and Caers, J, 2010, Stochastic Simulation of Patterns Using Distance-Based Pattern Modeling , Mathematical Geosciences, 42: 487–517