Abstract
Convolution of spectra, maps, or even higher dimensional data is often part of data reduction or analysis. Often a Gaussian kernel is used. When the convolved data are measurements, they are associated with uncertainties. This research notice derives how uncertainties propagate through the convolution. While the math is straightforward algebra, the results are not readily available. Here, the uncertainty propagation applied to regularly gridded data is provided. The calculation is done for uncorrelated data and correlated data.
Export citation and abstract BibTeX RIS
Original content from this work may be used under the terms of the Creative Commons Attribution 4.0 licence. Any further distribution of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI.
1. Introduction
Let's assume you are given observational data sampled on a regular grid with associated uncertainties. And you may need to convolve the data, e.g., with a Gaussian. Below, we derive the propagation of the uncertainties associated with the measurements through the convolution. The derivation of the variance and covariance is done first for a general kernel and then a Gaussian kernel is assumed. The first part of this Note goes through the exercise assuming uncorrelated data. The next part assumes data where neighboring points are correlated by a convolution with a Gaussian kernel. Even when the data was not correlated by such a convolution, similar correlations can be expected when the data is correlated, e.g., by an instrumental response that can be approximated with a Gaussian.
2. Uncorrelated Data
Let's start with uncorrelated regularly gridded data (pixels) in d dimensions. The data is indexed with with and . Let's call this set of indices, representing the pixels, . It is a subset of .
We describe the observation O with random variables , . The expected value is , the true signal. The variance is describing the uncertainty associated with the observations. To easily handle the edges of the data volume 1 , for .
The observations are independent from each other, thus the covariance is
If follows from that
For the convolution of O to the convolved data C, we use a kernel of () with a support , i.e., , smaller than the data grid ( and ). The kernel is normalized (). The convolution C of O with K can then be written as
To calculate how much the convolution correlates the initially uncorrelated data, we derive the covariance of C:
from
and
Thus, the variance is
In other words, to obtain the variance of convolved data, the variance of the data needs to be convolved with the square of the kernel used to convolve the data. Note that generally and that is the correct scaling for the variance.
If the kernel is a d-dimensional Gaussian
While mathematically the support of Kb is infinte, practically the support can be limited to a finite set of points . For useful values of b (), the normalization is .
The covariance then is
The covariance between two points is not zero, but is actually the variance of the midpoint between the two points scaled down with a Gaussian coefficient depending on the distance between the two points and the smoothing kernel width. While may not be an actual pixel, the expression is still well defined via the convolution in Equation (2).
Now, we have quantified how much the value in different pixels are correlated after smoothing the data set. That is important when, for example, doing aperture photometry on the smoothed map. The variance of the flux in the aperture is not just the sum of the variances of the pixels in the aperture.
3. Correlated Data
However, the pixels in the original data set may not be uncorrelated to begin with. Instrumental resolution, over-sampling, or for other reasons the data at hand may be correlated. For the following, we assume correlated data r with uncertainties σ and that the covariance can be estimated using the expression above (Equation (3)). The Gaussian correlation is motivated by the fact that instrumental responses can often be described by Gaussians.
Let's describe the correlated data with the above defined random variable , , with the expected value being and the variance . As above, for . The covariance is generally not zero for , but from above it should be reasonably described by
If is not a pixel but specifies an inter-pixel location, some interpolation is needed to define . We use nearest neighbors here (rounding up) for reasons that will become clear.
The convolution is as above . Thus, the variance is
because
Let's take the kernel again as a d-dimensional Gaussian with a reasonable width θ (see above): with Aθ so that . Then the variance is
Transforming the summation variables between is a relation between and points in satisfying , because .
To separate the sums, let us change the condition from involving both summation variable to . That changes the sum only slightly, because the Gaussian containing δ is a smooth function with respect to the grid, which samples it (), and this change in the summation just shifts the grid. Furthermore, since as index to got rounded up to a with only even entries, the shift does not change anything for sampling .
And instead of summing over all with the condition , we can sum over all and set .
The variance of the convolved correlated data is again the variance of the correlated data convolved with the square of the Gaussian kernel, but scaled with a factor depending on the widths of the Gaussian kernel and width of the Gaussian coefficient in the covariance.
4. Summary
The main take-away points around uncertainty propagation through a (Gaussian) convolution are:
- 1.To obtain the variances of convolved initially uncorrelated data, the variances of the data need to be convolved with the square of the kernel used to convolve the data (Equation (2)).
- 2.The covariance of data convolved with a Gaussian is the variance of the convolved data at the midpoint between the two points scaled down (Equation (3)).
- 3.The variance of the convolved correlated data is again the variance of the correlated data convolved with the square of the Gaussian kernel, but scaled with a factor depending on the widths of the Gaussian kernel and width of the Gaussian coefficient in the covariance (Equation (5)).
This research was conducted at the SOFIA Science Center, which is operated by the Universities Space Research Association under contract NNA17BF53C with the National Aeronautics and Space Administration.
Footnotes
- 1
The edges can be handled differently. The results derived here will not depend on how the edges are handled.