简体   繁体   English

如何在R中执行加权的2d内核密度估计?

[英]How do a perform a weighted, 2d kernel density estimation in R?

I would like to produce a kernel density estimation in R, and am somewhat bamboozled by all the different packages. 我想在R中产生内核密度估计,并且对所有不同的软件包都有些困惑。 I need to be able to: 我需要能够:

  1. Specify weights 指定权重
  2. Specify bandwidth size 指定带宽大小
  3. Specify bin size 指定纸槽大小

How would you go about this? 您将如何处理? Bonus points for a code snippet. 代码段的奖励积分。

Off course there's a number of packages. 当然,这里有很多包裹。 You should first decide which 2D kernel estimate you want. 你应该先决定哪些 2D核估计你想要的。 In the fields package you have a function smooth.2d, and you have the wonderful package of Brian Ripley, KernSmooth. 在fields程序包中,您具有函数smooth.2d,并且您具有KernSmooth的Brian Ripley出色的程序包。 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 . 对于此类问题,也请尝试www.rseek.org

另请参阅ks程序包多变量内核密度估计中的精美图片。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM