This article needs additional citations for
verification. (August 2009) |
In mathematics, a Gaussian function, often simply referred to as a Gaussian, is a function of the base form
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.
Gaussian functions arise by composing the exponential function with a concave quadratic function:
(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
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:
The integral of an arbitrary Gaussian function is
An alternative form is
The integral
Then, using the Gaussian integral identity
we have
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
Using this formulation, the figure on the right can be created using A = 1, (x0, y0) = (0, 0), a = c = 1/2, b = 0.
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
To get back the coefficients , and from , and use
Example rotations of Gaussian blobs can be seen in the following examples:
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.
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:
In an -dimensional space a Gaussian function can be defined as
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
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.
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]
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]
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]
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]
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]
Gaussian functions appear in many contexts in the natural sciences, the social sciences, mathematics, and engineering. Some examples include:
This article needs additional citations for
verification. (August 2009) |
In mathematics, a Gaussian function, often simply referred to as a Gaussian, is a function of the base form
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.
Gaussian functions arise by composing the exponential function with a concave quadratic function:
(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
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:
The integral of an arbitrary Gaussian function is
An alternative form is
The integral
Then, using the Gaussian integral identity
we have
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
Using this formulation, the figure on the right can be created using A = 1, (x0, y0) = (0, 0), a = c = 1/2, b = 0.
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
To get back the coefficients , and from , and use
Example rotations of Gaussian blobs can be seen in the following examples:
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.
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:
In an -dimensional space a Gaussian function can be defined as
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
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.
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]
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]
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]
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]
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]
Gaussian functions appear in many contexts in the natural sciences, the social sciences, mathematics, and engineering. Some examples include: