runifpoint(spatstat)
runifpoint()所属R语言包:spatstat
Generate N Uniform Random Points
产生N个均匀分布的随机点
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Generate a random point pattern containing n independent uniform random points.
生成一个随机的点模式n独立均匀分布的随机点。
用法----------Usage----------
runifpoint(n, win=owin(c(0,1),c(0,1)), giveup=1000)
参数----------Arguments----------
参数:n
Number of points.
点的数量。
参数:win
Window in which to simulate the pattern. An object of class "owin" or something acceptable to as.owin.
在模拟模式的窗口。类的一个对象"owin"或接受的as.owin的东西。
参数:giveup
Number of attempts in the rejection method after which the algorithm should stop trying to generate new points.
在抑制方法的尝试之后,算法应该停止试图产生新的点的数目。
Details
详细信息----------Details----------
This function generates n independent random points, uniformly distributed in the window win. (For nonuniform distributions, see rpoint.)
这个函数生成n独立的随机点,均匀分布在窗口win。 (非均匀分布,rpoint。)
The algorithm depends on the type of window, as follows:
该算法依赖于窗口的类型,如下所示:
If win is a rectangle then n independent random points, uniformly distributed in the rectangle, are generated by assigning uniform random values to their cartesian coordinates.
如果win是一个矩形,然后n独立的随机点,均匀地分布在该矩形,所产生的均匀分布的随机值,以分配它们的直角坐标系。
If win is a binary image mask, then a random sequence of pixels is selected (using sample) with equal probabilities. Then for each pixel in the sequence we generate a uniformly distributed random point in that pixel.
如果win是一个二进制图像掩模,然后选择一个随机序列的象素(使用sample)与相等概率。然后,序列中的每个像素中,我们在该像素中产生均匀分布的随机点。
If win is a polygonal window, the algorithm uses the rejection method. It finds a rectangle enclosing the window, generates points in this rectangle, and tests whether they fall in the desired window. It gives up when giveup * n tests have been performed without yielding n successes.
win如果是一个多边形窗口,该算法使用的抑制方法。它找到一个封闭窗口的矩形,生成点,在这个矩形,并测试是否他们所需的窗口中。放弃giveup * n测试时不产生n成功。
The algorithm for binary image masks is faster than the rejection method but involves discretisation.
算法二值图像口罩的速度比抑制方法,但涉及离散。
值----------Value----------
The simulated point pattern (an object of class "ppp").
的模拟点模式(类的一个对象"ppp"“)。
(作者)----------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----------
ppp.object, owin.object, rpoispp, rpoint
ppp.object,owin.object,rpoispp,rpoint
实例----------Examples----------
# 100 random points in the unit square[在单位面积的100个随机点]
pp <- runifpoint(100)
# irregular window[不规则窗口]
data(letterR)
# polygonal[多边形]
pp <- runifpoint(100, letterR)
# binary image mask[二值图像掩码]
pp <- runifpoint(100, as.mask(letterR))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|