Fast Kernel Density Estimator (Multivariate)
The code implements an approximation of the multivariate bandwidth calculation from [1]. In contrast to other multivariate bandwidth estimators, it can be estimated from a preclustered sample distribution offering a simple way of estimating compact and accurate KDEs with variable kernels.
The code provides a C source code for the engine of calculation and a routine to compile it automatically in Matlab.
The code includes three demos:
1. Multivariate KDE: demoBW_Estimation.m (it also compiles your code)
2. 1D KDE: demoBW_Estimation1D.m
3. Multivariate KDE with preclustering: demoBW_with_preclustering
Reasons to use the bandwidth estimator from [1]:
* Reasonably fast computation
* Handles multivariate bandwidths
* Can use weighted data
* Generally produces good estimates of the bandwidths
* Can be calculated from a Gaussian mixture model, not only directly from the samples
* Avoids numerical evaluations and iterative computation -- the bandwidth is analytically computed (even from a GMM) under some approximations.
Some advice:
If you're trying to estimate the KDE from "really" large datasets, then I suggest one of two things: (i) precluster the data first and apply [1]. (2) Use the online KDE, which learns the model by one data at a time -- the Matlab code for the oKDE is available from the author's homepage (http://www.vicos.si/People/Matejk).
[1] M. Kristan, A. Leonardis, D. Skočaj, "Multivariate online Kernel Density Estimation with Gaussian Kernels", Pattern Recognition, 2011.
Citation pour cette source
Matej Kristan (2025). Fast Kernel Density Estimator (Multivariate) (https://fr.mathworks.com/matlabcentral/fileexchange/41187-fast-kernel-density-estimator-multivariate), MATLAB Central File Exchange. Extrait(e) le .
Compatibilité avec les versions de MATLAB
Plateformes compatibles
Windows macOS LinuxCatégories
- AI and Statistics > Statistics and Machine Learning Toolbox > Cluster Analysis and Anomaly Detection > Gaussian Mixture Models >
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Découvrir Live Editor
Créez des scripts avec du code, des résultats et du texte formaté dans un même document exécutable.
C_code/
drawTools/
tools/
| Version | Publié le | Notes de version | |
|---|---|---|---|
| 1.7.0.0 | Corrected plotting of a 1d distribution and some includes for properly installing the path to plotting tools. |
||
| 1.5.0.0 | added link to homepage |
||
| 1.4.0.0 | updated the "Description" field. |
||
| 1.3.0.0 | Some correction of the code for moment matching "momentMatchPdf.m" and additional example of very fast 1D KDE estimation "demoBW_Estimation1D.m". |
||
| 1.0.0.0 |