python - 自适应带宽核密度估计

标签 python kernel-density

似乎有大量的信息和工具可用于实现标准多变量或单变量核密度估计。然而,我目前使用的离散地理数据特别稀疏,并且往往聚集在人口密度高的地区。

也就是说,我在 map 上有许多点(经度和纬度),我想估计给定这些点的概率密度,但我需要以某种方式对人口密度进行标准化。环顾四周,解决此类问题的正确方法似乎是为内核估计实现某种最近邻自适应带宽。然而,stats.gaussian_kde 似乎不支持自适应带宽。有谁知道我如何自己实现这一点,或者是否有任何可用于自适应带宽 KDE 的软件包?

最佳答案

我在Python中搜索变量/自适应核密度估计包时遇到了这个问题。我意识到 OP 可能早已转移,但无论如何,这就是我发现的:

  • AdaptiveKDE (用于自适应核密度估计的 Python 模块)

    This package implements adaptive kernel density estimation algorithms for 1-dimensional signals developed by Hideaki Shimazaki. This enables the generation of smoothed histograms that preserve important density features at multiple scales, as opposed to naive single-bandwidth kernel density methods that can either over or under smooth density estimates.

  • awkde (采用高斯内核的自适应宽度 KDE)

    The kernel bandwith is choosen locally to account for variations in the density of the data. Areas with large density gets smaller kernels and vice versa. This smoothes the tails and gets high resolution in high statistics regions.

    This uses the awesome pybind11 package which makes creating C++ bindings super convenient. Only the evaluation is written in a small C++ snippet to speed it up, the rest is a pure python implementation.

最后一个没有自适应方法,但包含 algorithm这非常适合多模式分布。

  • KDEpy (Python 中的核密度估计)

    This Python 3.5+ package implements various kernel density estimators (KDE). Three algorithms are implemented through the same API: NaiveKDE, TreeKDE and FFTKDE. The class FFTKDE outperforms other popular implementations, see the comparison page.

关于python - 自适应带宽核密度估计,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31483625/

相关文章:

python - Seaborn 热图未显示从字符串转换为数字的列

python - Pyplot/matplotlib 线图 - 相同颜色

Python高斯核密度计算新值的分数

Python Scipy 内核密度估计平滑问题

python - 从 python 生成的文本文件中删除双方括号和单方括号

python - 生产服务器上出现 NoReverseMatch at/error,但本地没有问题

python - Gensim FastText 计算训练损失

r - geom_密度未使用scale_y_log10正确填充

python - gaussian_filter和gaussian_kde中sigma和带宽的关系

python - 如何在python中返回通过sklearn的函数KernelDensity估计的分布的平均值(或期望值)?