rmpoispp(spatstat)
rmpoispp()所属R语言包:spatstat
Generate Multitype Poisson Point Pattern
生成多类型,的泊松点的模式
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Generate a random point pattern, a realisation of the (homogeneous or inhomogeneous) multitype Poisson process.
生成一个随机点模式,实现多类型的(均匀或不均匀)泊松过程。
用法----------Usage----------
rmpoispp(lambda, lmax=NULL, win, types, ...)
参数----------Arguments----------
参数:lambda
Intensity of the multitype Poisson process. Either a single positive number, a vector, a function(x,y,m, ...), a pixel image, a list of functions function(x,y, ...), or a list of pixel images.
多类型的泊松过程的强度。无论是单一的正数,一个向量,一个function(x,y,m, ...),一个像素的图像的功能的列表function(x,y, ...),或像素的图像的列表。
参数:lmax
An upper bound for the value of lambda. May be omitted
一个上界值的lambda。可以省略
参数:win
Window in which to simulate the pattern. An object of class "owin" or something acceptable to as.owin. Ignored if lambda is a pixel image or list of images.
在模拟模式的窗口。类的一个对象"owin"或接受的as.owin的东西。如果忽略lambda是一个像素的图像的图像列表。
参数:types
All the possible types for the multitype pattern.
所有可能的类型为多类型的模式。
参数:...
Arguments passed to lambda if it is a function.
参数传递给lambda,如果它是一个函数。
Details
详细信息----------Details----------
This function generates a realisation of the marked Poisson point process with intensity lambda.
这个函数生成一个实现了显着的泊松点过程与强度lambda。
Note that the intensity function lambda(x,y,m) is the average number of points of type m per unit area near the location (x,y). Thus a marked point process with a constant intensity of 10 and three possible types will have an average of 30 points per unit area, with 10 points of each type on average.
需要注意的是的强度函数lambda(x,y,m)的是点附近的位置(x,y)类型为M,每单位面积的平均数量。因此,一个标记点具有恒定强度的10和三个可能的类型的方法将具有的平均每单位面积的30点,与每种类型10个点的平均。
The intensity function may be specified in any of the following ways.
可以通过以下方式在任何指定的强度函数。
If lambda is a single number, then this algorithm generates a realisation of the uniform marked Poisson process inside the window win with intensity lambda for each type. The total intensity of points of all types is lambda * length(types). The argument types must be given and determines the possible types in the multitype pattern.
如果lambda是单数,那么这个算法生成一个实现了统一的标泊松过程强度win每种类型的窗口内lambda。所有种类的点的总光强是lambda * length(types)。参数types必须在多类型的模式,并确定可能的类型。
If lambda is a numeric vector, then this algorithm generates a realisation of the stationary marked Poisson process inside the window win with intensity lambda[i] for points of type types[i]. The total intensity of points of all types is sum(lambda). The argument types defaults to seq(lambda).
如果lambda是一个数值向量,那么这个算法生成一个实现显着的泊松过程的固定窗口内的win与强度的lambda[i]点的类型types[i]。所有种类的点的总光强是sum(lambda)。参数types默认到seq(lambda)。
If lambda is a function, the process has intensity lambda(x,y,m,...) at spatial location (x,y) for points of type m. The function lambda must work correctly with vectors x, y and m, returning a vector of function values. (Note that m will be a factor with levels equal to types.) The value lmax, if present, must be an upper bound on the values of lambda(x,y,m,...) for all locations (x, y) inside the window win and all types m. The argument types must be given.
lambda如果是一个函数,过程强度lambda(x,y,m,...)在空间位置(x,y)的类型m点。 lambda的功能必须正常工作与向量x,y和m,返回函数值的向量。 (注m将各级等于types的的一个因素。)的价值lmax,如果存在的话,必须有一个上限的值lambda(x,y,m,...) (x, y)窗口内的位置win和各类m。参数types必须提供。
If lambda is a list of functions, the process has intensity lambda[[i]](x,y,...) at spatial location (x,y) for points of type types[i]. The function lambda[[i]] must work correctly with vectors x and y, returning a vector of function values. The value lmax, if given, must be an upper bound on the values of lambda(x,y,...) for all locations (x, y) inside the window win. The argument types defaults to seq(lambda).
如果lambda是一个功能列表,该工艺具有强度lambda[[i]](x,y,...)在空间位置(x,y)的类型types[i]点。 lambda[[i]]的功能必须正常工作与向量x和y,返回函数值的向量。值lmax,如果给定的,必须有一个上限的值lambda(x,y,...)的所有位置(x, y)窗口内的win。参数types默认到seq(lambda)。
If lambda is a pixel image object of class "im" (see im.object), the intensity at a location (x,y) for points of any type is equal to the pixel value of lambda for the pixel nearest to (x,y). The argument win is ignored; the window of the pixel image is used instead. The argument types must be given.
如果lambda是一个像素的图像对象的类"im"(参见im.object),强度的位置处(x,y)的任何类型的点的像素值是等于 lambda像素最近的(x,y)。参数win被忽略的窗口像素的图像来代替。参数types必须提供。
If lambda is a list of pixel images, then the image lambda[[i]] determines the intensity of points of type types[i]. The argument win is ignored; the window of the pixel image is used instead. The argument types defaults to seq(lambda).
如果lambda是像素的图像,然后将图像lambda[[i]]的强度决定的类型types[i]点的列表。参数win被忽略的窗口像素的图像来代替。参数types默认到seq(lambda)。
If lmax is missing, an approximate upper bound will be calculated.
如果lmax缺少的近似上限将被计算。
To generate an inhomogeneous Poisson process the algorithm uses “thinning”: it first generates a uniform Poisson process of intensity lmax for points of each type m, then randomly deletes or retains each point independently, with retention probability p(x,y,m) = lambda(x,y)/lmax.
要生成一个非齐次泊松过程,该算法采用“疏”:首先生成一个统一的泊松过程的强度lmax点的各类型m,然后随机地删除或保留每个点,与保持独立概率p(x,y,m) = lambda(x,y)/lmax。
值----------Value----------
The simulated multitype point pattern (an object of class "ppp" with a component marks which is a factor).
模拟多类型的点模式(一个类的对象"ppp"与组件marks这是一个因素)。
(作者)----------Author(s)----------
Adrian Baddeley
<a href="mailto:Adrian.Baddeley@csiro.au">Adrian.Baddeley@csiro.au</a>
<a href="http://www.maths.uwa.edu.au/~adrian/">http://www.maths.uwa.edu.au/~adrian/</a>
and Rolf Turner
<a href="mailto:r.turner@auckland.ac.nz">r.turner@auckland.ac.nz</a>
参见----------See Also----------
rpoispp for unmarked Poisson point process; rmpoint for a fixed number of random marked points; ppp.object, owin.object.
rpoispp无人盯防的泊松点过程,“rmpoint固定数量的随机标记点; ppp.object,owin.object。
实例----------Examples----------
# uniform bivariate Poisson process with total intensity 100 in unit square[统一的二元泊松过程,在单位面积的总强度100]
pp <- rmpoispp(50, types=c("a","b"))
# stationary bivariate Poisson process with intensity A = 30, B = 70[固定二元泊松过程的强度A = 30,B = 70]
pp <- rmpoispp(c(30,70), types=c("A","B"))
pp <- rmpoispp(c(30,70))
# works in any window[在任何窗口的作品]
data(letterR)
pp <- rmpoispp(c(30,70), win=letterR, types=c("A","B"))
# inhomogeneous lambda(x,y,m)[不均匀的λ(X,Y,M)]
# note argument 'm' is a factor [附注参数m是一个因素]
lam <- function(x,y,m) { 50 * (x^2 + y^3) * ifelse(m=="A", 2, 1)}
pp <- rmpoispp(lam, win=letterR, types=c("A","B"))
# extra arguments[额外的参数]
lam <- function(x,y,m,scal) { scal * (x^2 + y^3) * ifelse(m=="A", 2, 1)}
pp <- rmpoispp(lam, win=letterR, types=c("A","B"), scal=50)
# list of functions lambda[[i]](x,y)[的函数列表拉姆达[[]](,)]
lams <- list(function(x,y){50 * x^2}, function(x,y){20 * abs(y)})
pp <- rmpoispp(lams, win=letterR, types=c("A","B"))
pp <- rmpoispp(lams, win=letterR)
# functions with extra arguments[功能与额外的参数]
lams <- list(function(x,y,scal){5 * scal * x^2},
function(x,y, scal){2 * scal * abs(y)})
pp <- rmpoispp(lams, win=letterR, types=c("A","B"), scal=10)
pp <- rmpoispp(lams, win=letterR, scal=10)
# florid example[绚丽的例子]
lams <- list(function(x,y){
100*exp((6*x + 5*y - 18*x^2 + 12*x*y - 9*y^2)/6)
}
# log quadratic trend[登录二次趋势]
,
function(x,y){
100*exp(-0.6*x+0.5*y)
}
# log linear trend[对数线性趋势]
)
X <- rmpoispp(lams, win=unit.square(), types=c("on", "off"))
# pixel image[图像像素]
Z <- as.im(function(x,y){30 * (x^2 + y^3)}, letterR)
pp <- rmpoispp(Z, types=c("A","B"))
# list of pixel images[像素的图像列表]
ZZ <- list(
as.im(function(x,y){20 * (x^2 + y^3)}, letterR),
as.im(function(x,y){40 * (x^3 + y^2)}, letterR))
pp <- rmpoispp(ZZ, types=c("A","B"))
pp <- rmpoispp(ZZ)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|