Kernel density estimation - Which approach is used by matlab?

2 views (last 30 days)
Hi,
I used the function "ksdensity(x)" to estimate a kernel density. Due to the fact that there are in generel different approaches to do so, I would like to know which is the standard algorithm that matlab uses while estimate this density.
In the help of matlab I just found a general reference for kernel density estimators.
Does someone can help me with this additional information?
Thanks in advance!
Greets, phanta

Accepted Answer

the cyclist
the cyclist on 24 Aug 2015
I'm guessing you are referring to the documentation for the ksdensity command specifically. The broader page about kernel distributions has more discussion, and might get you what you need.
Often, looking at the code itself, for example by typing
edit ksdensity
will help you glean specific algorithmic info, but it doesn't look like it will be that helpful in this case.

More Answers (1)

phanta
phanta on 25 Aug 2015
Hi,
thanks for your reply.
In the function I found the following statement:
'kernel' The type of kernel smoother to use, chosen from among
% 'normal' (default), 'box', 'triangle', and
% 'epanechnikov'
So I used the "normal" kernel, but I still not know which approach is behind that :-/
  1 Comment
the cyclist
the cyclist on 25 Aug 2015
Did you look at the documentation to kernel distribution, which I put in my answer? There is a picture that illustrates the kernel shapes (including "normal"), and also a description of the bandwidth parameter. It all seems pretty well explained to me.
[Also, note that what you wrote here as an "answer" would have more logically been placed as a comment on my answer.]

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!