Interpretation of Gaussian Kernel

In summary, the conversation discusses the use of a discrete Gaussian kernel in smoothing a data set in a software application. The value of the parameter "range" in the kernel is related to the standard deviation of a continuous Gaussian function, with a larger range corresponding to a larger standard deviation. Oversmoothing is possible and can be controlled by adjusting the width of the Gaussian. The conversation also touches on the use of spectroscopic data and the importance of selecting an appropriate range value for optimal smoothing.
  • #1
wil3
179
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:
[tex]
\dfrac{e^{-k^2/100}}{\sqrt{2 \pi}}
\qquad
\forall \; k \; \in \{-\text{range}, \text{range}\}; k \in \mathbb{Z}
[/tex]

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
  • #2
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.)
 
  • #3
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
 
  • #4
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 [itex]\sqrt{100/2}[/itex]. When you change the width of the Gaussian, range should be changed in proportion.
 
  • #5
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 [tex] \sqrt{50} [/tex] 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.
 

Related to Interpretation of Gaussian Kernel

What is a Gaussian Kernel?

A Gaussian Kernel is a mathematical function that is used for smoothing and filtering data. It is also known as a Gaussian filter or Gaussian blur. It is commonly used in image processing and machine learning applications.

How does a Gaussian Kernel work?

A Gaussian Kernel works by applying a weighted average to the data points within a certain radius. The weight of each data point is determined by its distance from the center point, with closer points having a higher weight. This results in a smoother and more accurate representation of the data.

What is the significance of the standard deviation in a Gaussian Kernel?

The standard deviation in a Gaussian Kernel determines the width of the bell-shaped curve used to calculate the weights of the data points. A larger standard deviation results in a wider curve and a smoother output, while a smaller standard deviation results in a narrower curve and a more precise output.

What are the advantages of using a Gaussian Kernel?

A Gaussian Kernel has several advantages, including its ability to effectively smooth noisy data and preserve edges in images. It is also computationally efficient and can be easily adjusted by changing the standard deviation to suit different data sets.

Are there any limitations to using a Gaussian Kernel?

One limitation of using a Gaussian Kernel is that it assumes the data is normally distributed and can result in oversmoothing in certain cases. It also requires careful tuning of the standard deviation to achieve the desired results. Additionally, the use of a Gaussian Kernel may not be appropriate for all types of data, such as data with sharp discontinuities or outliers.

Similar threads

Replies
8
Views
3K
Replies
3
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
775
  • High Energy, Nuclear, Particle Physics
Replies
2
Views
596
Replies
4
Views
628
Replies
8
Views
2K
Replies
11
Views
2K
Replies
1
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
5
Views
817
  • General Math
Replies
4
Views
13K
Back
Top