Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kernel density smoothing in d3.js

Tags:

d3.js

Apologies as I am an expert in neither statistics nor d3.js.

I am trying to overlay two smoothed histograms to show overlap in two related distributions.

I am wondering about the availability of kernel density or other smoothing in d3.js. There seemed to be some activity on the topic about a year ago, but I am not able to find the function in the mainline d3.js code. (The Wikipedia entry on kernel density estimation suggests d3's "science.stats" functions, which are not in my d3.v2.js download.)

Was it incorporated into the histogram layout with the density option? Or is it not available currently?

like image 496
josquin021 Avatar asked Jun 05 '12 18:06

josquin021


1 Answers

The example you are looking for is in the kde folder of the science.js git repository, which includes the kernel estimator.

Here's what it looks like: screenshot of kde.js in action

like image 117
mbostock Avatar answered Nov 12 '22 04:11

mbostock