0

I am applying a Gaussian filter to smooth my data in Python, specifically I am applying the scipy function gaussian_filter1d. This function receives the standard deviation for the gaussian distribution as an argument. It works great but I was exploring the ksmooth function in R which is based on the Nadayara-Watson kernel-regression estimate and it uses the bandwidth as a parameter.

I am wondering if there exists a relationship between the standard deviation and the bandwidth, and if both implementations are comparable.

  • 1
    For Gaussian kernel, standard deviation *is* the bandwidth. I marked it as a duplicate of another, similar, thread where you can find more detailed answer and some links for a follow up. – Tim Jun 10 '20 at 12:04
  • Thanks @Tim, I read those threads before. I was not getting the same results in Python and R. Now I checked the documentation for the `ksmooth` function in R and they scale the bandwidth parameter in such a way that the quartiles of the kernel are at +/- 0.25*bandwidth. Now I estimate a new standard deviation considering that fact and I get a similar result using the scipy function `gaussian_filter1d`. Just considering that the positions of the quartiles are at +/-0.675 standard deviations from the mean. – Escafandra Jun 10 '20 at 13:05
  • there may be differences in implementations, so you’d need to compare source codes. – Tim Jun 10 '20 at 13:43

0 Answers0