【问题标题】:Kernel Density Estimation for clustering 1 dimensional data聚类一维数据的核密度估计
【发布时间】:2015-06-30 04:49:52
【问题描述】:

我正在使用 Matlab 和提供的代码 http://www.mathworks.com/matlabcentral/fileexchange/14034-kernel-density-estimator/content/kde.m

对一维数据进行聚类。特别是我估计了我的数据的密度函数,然后分析了我应该能够识别形成我的数据集的不同分布的峰值。 (正确的?) 然后我根据这些聚类质心(密度函数的峰值)对点进行聚类。

您可以在以下位置找到我的数据 (z): https://drive.google.com/file/d/0B3vXKJ_zYaCJLUE3YkVBMmFtbUk/view?usp=sharing

和概率密度函数的图在: https://drive.google.com/file/d/0B3vXKJ_zYaCJTjVobHRBOXo4Tmc/view?usp=sharing

我所做的只是为了跑步

   [bandwidth,density,xmesh]=kde(z);

   plot(xmesh,density);

我得到的(请看第二个链接)是每个数据点的密度函数有 1 个峰值.... 我认为我做错了什么...... kde函数的默认参数可能是原因吗?

kde(data,n,MIN,MAX)
%     data    - a vector of data from which the density estimate is constructed;
%          n  - the number of mesh points used in the uniform discretization of the
%               interval [MIN, MAX]; n has to be a power of two; if n is not a power of two, then
%               n is rounded up to the next power of two, i.e., n is set to n=2^ceil(log2(n));
%               the default value of n is n=2^12;
%   MIN, MAX  - defines the interval [MIN,MAX] on which the density estimate is constructed;
%               the default values of MIN and MAX are:
%               MIN=min(data)-Range/10 and MAX=max(data)+Range/10, where Range=max(data)-min(data);

这可能吗?你能告诉我应该在什么基础上改变它们吗?

【问题讨论】:

  • 如何定义/检测密度函数中的峰值?
  • 我还没有做过,但是我通常使用爬山算法来解决这类问题。当然欢迎任何其他建议。
  • 您上传了一个 fig(不是 pdf)文件...
  • 是的,我知道。 pdf我的意思是概率密度函数......
  • 为什么不在你的帖子中加入这个数字?

标签: matlab cluster-analysis kde


【解决方案1】:

您在问题中指出了解决方案。文档建议该算法设置从数据创建的 2^N 个峰值的上限。默认值(16k 或 2^14)大于您提供的点数(~8k),导致“尖峰”行为。

如果你改为运行

 [bandwidth,density,xmesh]=kde(z,2^N);

对于 2^N 的不同值(该函数需要 2 的幂,必须是 FFT 的东西),您会得到如下图:

您可以据此选择合适的 N 值。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-10-14
    • 2013-07-23
    • 2015-12-20
    • 2016-05-07
    • 2018-10-06
    • 2015-07-20
    • 2016-12-10
    • 1970-01-01
    相关资源
    最近更新 更多