简体   繁体   中英

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. 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. 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 .

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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