Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adaptive Bandwidth Kernel Density Estimation

There seems to be a wealth of information and tools available for the implementation of standard multivariate or univariate kernel density estimation. However, the discrete geographic data I am currently working with is especially sparse and tends to cluster around areas of high population density.

That is to say, I have a number of points (longitude and latitude) on a map, and I would like to estimate a probability density given the points, but I need to somehow normalize for population density. From looking around, it seems as though the proper method for this type of problem would be to implement some sort of nearest-neighbor adaptive bandwidth for the kernel estimation. Yet, it seems as though the stats.gaussian_kde does not support adaptive bandwidth. Is anyone aware of how I might be able to implement this myself, or if there are any packages available for adaptive bandwidth KDE's?

like image 836
Balthasar Avatar asked Jul 17 '15 19:07

Balthasar


People also ask

What is bandwidth in kernel density estimation?

Kernal Density Estimation function, and is normalized to one (and so ĝ(x) is also normalized to 1). The parameter h is called the “bandwidth”, and scales the width of the kernel. Essentially this just means placing a smooth function at the. location of each data point and then summing the result.

How is kernel density estimate calculated?

Kernel Density Estimation (KDE) It is estimated simply by adding the kernel values (K) from all Xj. With reference to the above table, KDE for whole data set is obtained by adding all row values. The sum is then normalized by dividing the number of data points, which is six in this example.

What does kernel density estimation do?

The Kernel Density Estimation is a mathematic process of finding an estimate probability density function of a random variable. The estimation attempts to infer characteristics of a population, based on a finite data set.

What is kernel density estimation GIS?

Kernel Density calculates the density of features in a neighborhood around those features. It can be calculated for both point and line features. Possible uses include finding density of houses, crime reports or density of roads or utility lines influencing a town or wildlife habitat.


1 Answers

I came across this question searching for variable/adaptive kernel density estimation packages in Python. I realize the OP has probably long moved on, but here's what I've found anyway:

  • AdaptiveKDE (Python module for adaptive kernel density estimation)

    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 (Adaptive Width KDE with Gaussian Kernels)

    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.

This last one does not have an adaptive method, but includes an algorithm that is well suited for multimodal distributions.

  • KDEpy (Kernel Density Estimation in 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.

like image 96
Gabriel Avatar answered Oct 04 '22 17:10

Gabriel