如何计算R中分布数据的核密度估计

时间:2018-08-06 20:02:10

标签: r distribution spatial estimation

我想计算R中某些猎物分布数据的核密度估计。

我有16种猎物的空间分布(例如黑斑羚,牛羚,水牛),每年一次,为期4年。

我了解关于stackoverflow的KDE已经存在一些问题,但是对于我需要解决的空间方面没有什么涉及。

这是到目前为止,我从网上获取的代码,但是我真的不理解代码语法,所以盲目地输入值。

#'Kernel density estimation of prey distribution data

library("KernSmooth")

# get the coordinates
records <- prey_buffer
coordinates <- records[,3:4]                      <- what is 3,4?
d <- 50                                           <- what is 50?
lapply(a, as.numeric).

# compute the 2D binned kernel density estimate
est <- bkde2D(coordinates, 
          bandwidth=c(3,3),                       <- what is 3,3?
          gridsize=c(d,d),    
          range.x=list(c(-180,180),c(-90,90)))    <- what is in brackets?

任何人都可以确认这是否是我使用的正确语法,如果可以,那么如何知道将什么值放在哪里?

非常感谢!任何建议,我们将不胜感激!

0 个答案:

没有答案