如何用R模拟任意区域的空间泊松过程?

Cas*_*nco 1 simulation r spatial geospatial poisson

我正在研究R 3.0.1并进行了聚类泊松过程的模拟,R通常有一个默认区域,基本上是一个盒子,在下一张图片中你可以看到我的模拟:

在此输入图像描述

到目前为止,一切都很好,我想要做的就是模拟相同distribution但使用地理区域的麻烦,但我不知道如何更改参数以便使用地理坐标来获得不同的区域.例如:

在此输入图像描述

总而言之,基本上我想要做的是弄清楚如何为更大的区域改变这个区域,以便进行相同的模拟但是使用新区域.这是我试过的代码:

library(spatstat)

sim1 = rpoispp(100)
plot(sim1)
Run Code Online (Sandbox Code Playgroud)

Ric*_*mos 6

你可以试试这个:

require(spatstat)
require(maps)

lambda = 0.1 # intensity of the process
lon = c(-100,-70) # domain's longitude
lat = c(-40,10)   # domain's latitude

sim = rpoispp(lambda, win=c(lon,lat))

# do the plot
par(mar=c(1,1,1,1))
map("world", xlim=lon, ylim=lat, fill=TRUE)
map.axes() # add axes
plot(sim, chars=19, cols="red",cex=0.5, add=TRUE)

# add other process

lon1 = c(-95,-85) # other area
lat1 = c(-5,5)
sim1 = rpoispp(5*lambda, win=c(lon1,lat1))
plot(sim1, chars=19, cols="blue",cex=0.5, add=TRUE)
Run Code Online (Sandbox Code Playgroud)

最终地图