Interpretation of Gaussian Kernel

Click For Summary
The discussion centers on the relationship between the "range" parameter in a discrete Gaussian kernel and the standard deviation of a continuous Gaussian function. It is clarified that while an infinite range would provide perfect Gaussian smoothing, practical applications require a finite range, typically around three standard deviations for reasonable accuracy. Participants note that the range significantly affects the shape of the smoothed curve, and oversmoothing can occur if the range is not properly managed. The standard deviation is derived from the kernel's formula, specifically as √(100/2), which helps in determining the appropriate range. The conversation emphasizes the importance of understanding these parameters for effective data smoothing in applications like spectroscopy.
wil3
Messages
177
Reaction score
1
Hello. In a software application I am attempting to smooth a data set by convoluting it with a discrete Gaussian kernel. Based upon information garnered online, I've been using this Mathematica command to generate the kernel:

kern = Table[Exp[-k^2/100]/Sqrt[2. Pi], {k, -range, range}];

where range is a user-specified parameter. For non-Mathematica speakers, my kernel is:
<br /> \dfrac{e^{-k^2/100}}{\sqrt{2 \pi}}<br /> \qquad<br /> \forall \; k \; \in \{-\text{range}, \text{range}\}; k \in \mathbb{Z}<br />

What is the correct relation of the parameter "range" in this kernel to the standard deviation of a continuous Gaussian function? I'm aware that a large range correlates to a larger standard deviation Gaussian over which the data is sampled, but I would like to know the precise relation. I can't seem to figure it out because the Gaussian and the discrete kernel seem to have slightly different forms.

Application: I have spectroscopic data, and I have been finding that certain "range" values yield the best-fit smoothing. I am curious whether this is related to the standard deviations of the continuous Gaussian functions that comprise the spectra that I am smoothing.

Thanks very much.
 
Last edited:
Mathematics news on Phys.org
The truly correct value of range, to give perfect Gaussian smoothing, is infinite. In practice, of course, that's inconvenient, and you have to decide how much accuracy you're willing to sacrifice by lopping off the tails. I imagine that in practice 3 standard deviations would be reasonable. (But be careful about normalization.)
 
It seems to me that the value of range has a noticeable effect on the shape of a smoothed curve... are you certain about that? Because I think that oversmoothing definitely is possible.

But thanks for taking a crack at it. I guess I'm being a little particular
 
wil3 said:
It seems to me that the value of range has a noticeable effect on the shape of a smoothed curve... are you certain about that? Because I think that oversmoothing definitely is possible.

But thanks for taking a crack at it. I guess I'm being a little particular
Yes, of course the value of range has an effect. I must not have been clear, if you thought I said it didn't have an effect.

Oversmoothing is of course possible. The main way you control that is by controlling the width (i.e., SD) of the Gaussian. That, in your example, is \sqrt{100/2}. When you change the width of the Gaussian, range should be changed in proportion.
 
Ahh, I understand now. I was thinking that the Standard deviation must be around 7, so that is good to hear. I had originally thought that \sqrt{50} must be it, but I guess I got confused because Mathematica is giving me very different graphs as I increase "range" without bound, making me think that something else is affecting the convolution.

Anyway, sorry for the misunderstanding. Thanks very much for your help.
 
Here is a little puzzle from the book 100 Geometric Games by Pierre Berloquin. The side of a small square is one meter long and the side of a larger square one and a half meters long. One vertex of the large square is at the center of the small square. The side of the large square cuts two sides of the small square into one- third parts and two-thirds parts. What is the area where the squares overlap?

Similar threads

Replies
3
Views
2K
Replies
8
Views
3K
  • · Replies 4 ·
Replies
4
Views
13K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 7 ·
Replies
7
Views
1K