How to estimate the Gaussain kernel based on spatial bandwidth for KDE

Hi,
I want to use bandwidth h= 10 to estimate Gaussian Kernel
Not sure how to use it for each point
please advice

댓글 수: 1

What does "bandwidth" mean in this context? It usually refers to the width of a range of frequencies in a spectral (Fourier) domain. Do you mean the spatial width of the Gaussian in the spatial domain?

댓글을 달려면 로그인하십시오.

답변 (3개)

the cyclist
the cyclist 2014년 11월 21일

0 개 추천

If you have the Statistics Toolbox, you can use the ksdensity function for this, and set the bandwidth as a parameter.

댓글 수: 1

Tania
Tania 2014년 11월 21일
편집: Tania 2014년 11월 21일
Is it possible to use it in a loop (without the toolbox)?
Not sure how to do this.
Any advice will be appreciated.

댓글을 달려면 로그인하십시오.

the cyclist
the cyclist 2014년 11월 21일

0 개 추천

I suggest you take a look at kde in the MATLAB File Exchange.
Even if this function does not help you directly, it may give you some hints at how to code what you need yourself.

댓글 수: 5

I have read the ksdensity as you have mentioned. But not much information how to calculate kernel size using the spatial bandwidth. Am I going to the wrong direction?
Please advice.
Again, define bandwidth, which you now call spatial bandwidth. Is this simply the spatial width of the Gaussian, like how wide it is in your image?
@ Image Analyst: the bandwidth is defined in the wikipedia page about kernel density estimation
the cyclist
the cyclist 2014년 11월 21일
편집: the cyclist 2014년 11월 21일
@tania:
The kde function I mentioned in this answer is not the ksdensity function supplied by MATLAB itself. It is a user-contributed function at the File Exchange that seems to do much of what you want to do.
I am going to say something that might sound a bit harsh. Sorry.
It seems that you don't know a lot about kernel density estimation, and you also don't know a lot about MATLAB. I am not confident we can really teach you both of these things in this forum.
The kde file is very well documented code that does much of what you need. If at all possible, you need to study that, and maybe you need to find someone locally who understands MATLAB really well, or kernel density estimation really well, to help you understand what that code is doing.
I am totally new to this. Will follow your advice. ty

댓글을 달려면 로그인하십시오.

Image Analyst
Image Analyst 2014년 11월 21일

0 개 추천

Lacking a clear definition of bandwidth, I'm going to hurl out a SWAG: how about if you use the fspecial() function to create a Gaussian? It will create a small array where the window width in elements, and the standard deviations (width within the window) is what you specify.

댓글 수: 1

  • Let me explain again.
Mean shift is a procedure for locating the maxima of a density function given discrete data sampled from that function. It is useful for detecting the modes of this density.This is an iterative method, and we start with an initial estimate x . Let a kernel function K(x_i - x) be given. This function determines the weight of nearby points for re-estimation of the mean. Typically a Gaussian kernel on the distance to the current estimate is used, K(x_i - x) = e^{-c||x_i - x||^2} .

댓글을 달려면 로그인하십시오.

질문:

2014년 11월 21일

편집:

2014년 11월 21일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by