如何在 R 中执行加权二维核密度估计?
我想在 R 中生成核密度估计,并且对所有不同的包有些迷惑。我需要能够:
- 指定权重
- 指定带宽大小
- 指定 bin 大小
您会如何处理?代码片段的奖励积分。
I would like to produce a kernel density estimation in R, and am somewhat bamboozled by all the different packages. I need to be able to:
- Specify weights
- Specify bandwidth size
- Specify bin size
How would you go about this? Bonus points for a code snippet.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
另请参阅 ks 包
和里面的漂亮图片
多元核密度估计。
See also the ks package
and the nice picture in
Multivariate kernel density estimation.
当然还有很多套餐。您应该首先决定您想要哪种 2D 内核估计。在 fields 包中,您有一个函数 smooth.2d,并且您有 Brian Ripley 的精彩包 KernSmooth。您可以在帮助文件中提供额外的代码片段,我不会复制它们。
对于此类问题,还可以尝试 www.rseek.org。
Of course there are a number of packages. You should first decide which 2D kernel estimate you want. In the fields package you have a function smooth.2d, and you have the wonderful package of Brian Ripley, KernSmooth. The extra points for the code snippets you can give to the help files, I ain't going to copy them.
For these kind of questions, also try www.rseek.org.