How can I achieve a graph for estimating the core density R using D3.js?

This is my R code:

x <- c(5.89,6.81,6.69,7.61,5.44,6.17)
y <- c(1,0.09392423,0.07090779,0.0687634,0.06819157,0.06261615)

plot(density(x, bw=0.050, adjust=1, kernel="gaussian",weights=(y),n=1000))

I am trying to achieve the same result using D3.js or any other equivalent JavaScript library.

Can anyone help?

+5
source share
1 answer

Have you seen an example of kernel density estimation ?

kernel density estimation

Admittedly, it uses the core of Epanechnikov, not Gaussian, but this part can be changed.

+7
source

All Articles