javascript - How can I achieve the R kernel density estimate plot using D3.js? - Stack Overflow

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,

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'm trying to achieve the same result using D3.js or any other equivalent JavaScript library..

Can somebody please help?

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'm trying to achieve the same result using D3.js or any other equivalent JavaScript library..

Can somebody please help?

Share Improve this question edited Apr 10, 2014 at 2:02 VividD 10.5k8 gold badges66 silver badges112 bronze badges asked Apr 22, 2013 at 12:32 giorgiocagiorgioca 7131 gold badge8 silver badges21 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 7

Have you seen the kernel density estimation example?

Admittedly it uses the Epanechnikov kernel rather than Gaussian, but that part could be modified.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745582133a4634317.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信