← Back
Heatmap - Kernel Density Estimation
Summary
In this video I am going to show you how you can code heatmaps yourself and place them on any real world map you wish. I'll guide you through the math and how we can color each pixel. And here's the fun part. We are doing everything from scratch. So, no libraries, no frameworks, just pure coding.
Math
The heatmap intensity at each pixel is computed with kernel density estimation:
For this heatmap we use a bandwidth of .
In code, using a Gaussian kernel, this looks like:
GitHub
You can find the code here.