https://github.com/parham1998/kernel-density-estimation
Implementation of Kernel-Density-Estimation (KDE) with Matlab
https://github.com/parham1998/kernel-density-estimation
density-estimation gaussian-kernel gaussian-mixture-models kernel-density-estimation matlab pattern-recognition theodoridis
Last synced: 3 months ago
JSON representation
Implementation of Kernel-Density-Estimation (KDE) with Matlab
- Host: GitHub
- URL: https://github.com/parham1998/kernel-density-estimation
- Owner: parham1998
- Created: 2021-06-11T17:09:10.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-10-23T11:23:29.000Z (about 4 years ago)
- Last Synced: 2025-10-10T04:33:40.010Z (3 months ago)
- Topics: density-estimation, gaussian-kernel, gaussian-mixture-models, kernel-density-estimation, matlab, pattern-recognition, theodoridis
- Language: MATLAB
- Homepage:
- Size: 668 KB
- Stars: 7
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Kernel-Density-Estimation (warm-up project!)
Implementation of Kernel-Density-Estimation (KDE) with Matlab
### smooth kernel function (Gaussian kernel)

## example1
### pdf

### figure1 (N = 1000, h = 0.1)

### figure2 (N = 1000, h = 0.01)

### figure3 (N = 10000, h = 0.1)

## example2
### pdf

### figure0 (real distribution)

### figure1 (N = 1000, h = 0.1)

### figure2 (N = 1000, h = 0.01)

### figure3 (N = 10000, h = 0.1)

### results
As expected, the estimated density will be more accurate with more data points (see figure3 in example1 and example2). furthermore, a large ℎ will over-smooth the density estimation and mask the structure of the data, and a small ℎ will yield a density estimation that is spiky and very hard to interpret. (see image below)

I prefer using the smooth kernel function instead of the parzen window because parzen window yields density estimates that have discontinuities, and weights equally all points, regardless of their distance to the estimation point.
**If we had unlimited data points, the best result would be obtained by bringing h near zero.**