找回密码
 注册
查看: 268|回复: 0

R语言 spatstat包 rpoint()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-30 14:09:48 | 显示全部楼层 |阅读模式
rpoint(spatstat)
rpoint()所属R语言包:spatstat

                                        Generate N Random Points
                                         生成N个随机点

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

Generate a random point pattern containing n independent, identically distributed random points with any specified distribution.
n独立,同分布的随机点与任何指定的分布,生成一个随机点模式。


用法----------Usage----------


rpoint(n, f, fmax=NULL, win=unit.square(), ..., giveup=1000, verbose=FALSE)



参数----------Arguments----------

参数:n
Number of points to generate.  
数目的点来生成。


参数:f
The probability density of the points, possibly un-normalised. Either a constant, a function f(x,y,...), or a pixel image object.  
概率密度之分,可能未归。是一个常量,函数f(x,y,...),或一个像素的图像对象。


参数:fmax
An upper bound on the values of f. If missing, this number will be estimated.  
一个上界的值f。如果缺少,这一数字将估计。


参数:win
Window in which to simulate the pattern. Ignored if f is a pixel image.  
在模拟模式的窗口。如果忽略f是一个像素的图像。


参数:...
Arguments passed to the function f.  
传递参数函数f。


参数:giveup
Number of attempts in the rejection method after which the algorithm should stop trying to generate new points.  
在抑制方法的尝试之后,算法应该停止试图产生新的点的数目。


参数:verbose
Flag indicating whether to report details of performance of the simulation algorithm.  
标志,指示是否要报告的模拟算法的性能的详细信息。


Details

详细信息----------Details----------

This function generates n independent, identically distributed random points with common probability density proportional to f.
这个函数生成n独立,同分布的随机点与常见的概率密度成正比,f。

The argument f may be
的参数f可能是

uniformly distributed random points will be generated.
将产生均匀分布的随机点。




a function: random points will be generated in the window win with probability density proportional to f(x,y,...) where x and y are the cartesian coordinates. The function f must accept  two vectors of coordinates x,y and return the corresponding vector of function values. Additional arguments ... of any kind may be passed to the function.
在窗口中会产生一个功能:随机点win的概率密度成正比,f(x,y,...)其中x和y是在直角坐标系。函数f必须接受两个向量的坐标x,y和函数值返回对应的向量。的其他参数...的任何一种可能被传递给函数。




a pixel image: if f is a pixel image object of class "im" (see im.object) then random points will be generated in the window of this pixel image, with probability density proportional to the pixel values of f.
像素的图像:如果f是一个像素的图像类的对象"im"(见im.object),然后随机点产生的这个像素的图像在窗口中,概率密度成正比的f的像素值。

The algorithm is as follows:
该算法是如下:

If f is a constant, we invoke runifpoint.
如果f是一个常数,我们调用“runifpoint。

If f is a function, then we use the rejection method. Proposal points are generated from the uniform distribution. A proposal point (x,y) is accepted with probability f(x,y,...)/fmax and otherwise rejected. The algorithm continues until n points have been accepted. It gives up after giveup * n proposals if there are still fewer than n points.
如果f是一个函数,那么我们使用的抑制方法。提案点所产生的均匀分布。的建议的(x,y)点的概率f(x,y,...)/fmax“,否则拒绝接受。该算法将继续直到n点已被接受。它放弃后,如果仍然有不到giveup * n点n建议。

If f is a pixel image, then a random sequence of  pixels is selected (using sample) with probabilities proportional to the pixel values of f.  Then for each pixel in the sequence we generate a uniformly distributed random point in that pixel.
如果f是一个像素的图像,然后选择一个随机序列的像素(使用sample)的概率f的像素值成正比。然后,序列中的每个像素中,我们在该像素中产生均匀分布的随机点。

The algorithm for pixel images is more efficient than that for functions.
像素的图像的算法是更有效率比的函数。


值----------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, runifpoint
ppp.object,owin.object,runifpoint


实例----------Examples----------


# 100 uniform random points in the unit square[在单位正方形的100个均匀分布的随机点]
X <- rpoint(100)

# 100 random points with probability density proportional to x^2 + y^2[100个随机点的概率密度成正比,X ^ 2 + Y ^ 2]
X <- rpoint(100, function(x,y) { x^2 + y^2}, 1)

# `fmax' may be omitted[fmax的可以省略]
X <- rpoint(100, function(x,y) { x^2 + y^2})

# irregular window[不规则窗口]
data(letterR)
X <- rpoint(100, function(x,y) { x^2 + y^2}, win=letterR)

# make a pixel image [像素图像]
Z <- setcov(letterR)
# 100 points with density proportional to pixel values[100点数成比例的像素值与密度]
X <- rpoint(100, Z)

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-6-17 05:11 , Processed in 0.040728 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表