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

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

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

                                        Prediction from a Fitted Point Process Model
                                         从安装点过程模型的预测

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

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

Given a fitted point process model obtained by ppm,         evaluate the spatial trend or the conditional intensity of the model at new locations.
由于得到一个拟合点过程模型ppm,评估的空间的趋势或条件强度的模型在新的位置。


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


   ## S3 method for class 'ppm'
predict(object, window, ngrid=NULL, locations=NULL,
   covariates=NULL, type="trend", X=data.ppm(object),
   ..., check=TRUE, repair=TRUE)



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

参数:object
A fitted point process model, typically obtained from the model-fitting algorithm ppm. An object of class "ppm" (see ppm.object).  
已安装点过程模型,从模型的拟合算法ppm通常得到。类的一个对象"ppm"(见ppm.object)。


参数:window
Optional. A window (object of class "owin") delimiting the locations where predictions should be computed. Defaults to the window of the original data used to fit the model object.  
可选。一个窗口(对象类"owin")划定的预测计算的地方。默认的窗口的原始数据拟合模型object。


参数:ngrid
Optional. Dimensions of a rectangular grid of locations inside window where the predictions should be computed. An integer, or an integer vector of length 2, specifying the number of grid points in the y and x directions. (Incompatible with locations)  
可选。尺寸的矩形网格内window的预测计算的位置。一个整数或整数向量长度为2,指定y和x方向网格点的数量。 (不相容的locations)


参数:locations
Optional. Data giving the x,y coordinates (and marks, if required) of locations at which predictions should be computed. Either a point pattern, or a data frame with columns named x and y, or a binary image mask. (Incompatible with ngrid)  
可选。给予x,y应当计算在该预测的位置的坐标(及标记,如果需要的话)的数据。无论是点模式,或者一个数据框列名为x和y,或二进制图像遮罩。 (不相容的ngrid)


参数:covariates
Values of external covariates required by the model. Either a data frame or a list of images. See Details.  
模型所需的外部协变量的值。无论是数据框或图像的列表。查看详细信息。


参数:type
Character string. Indicates which property of the fitted model should be predicted. Options are "trend" for the spatial trend,  "cif" or "lambda" for the conditional intensity, and "se" for the standard error of the fitted spatial trend.  
字符的字符串。表示财产的拟合模型进行预测。选项是"trend"的空间趋势,"cif"或"lambda"为有条件的强度,和"se"的标准错误的安装空间趋势。


参数:X
Optional. A point pattern (object of class "ppp") to be taken as the data point pattern when calculating the conditional intensity. The default is to use the original data to which the model was fitted.  
可选。点模式(类的对象"ppp")被视为有条件的强度计算时的数据点模式。默认情况下使用的原始数据,模型拟合。


参数:...
Ignored.  
忽略。


参数:check
Logical value indicating whether to check the internal format of object. If there is any possibility that this object has been restored from a dump file, or has otherwise lost track of the environment where it was originally computed, set check=TRUE.   
逻辑值,该值指示是否要检查的内部格式object。如果有任何可能,这个对象已经从dump文件中恢复,或以其他方式失去它最初被计算的环境中,设置check=TRUE。


参数:repair
Logical value indicating whether to repair the internal format of object, if it is found to be damaged.   
逻辑值,该值指示是否要修复的内部格式object,如果它被发现损坏。


Details

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

This function computes the spatial trend  and the conditional intensity of a fitted spatial point process model, and the standard error of the estimate of spatial trend. See Baddeley and Turner (2000) for explanation and examples.
此函数计算的空间趋势和条件的安装空间点过程模型的强度,空间趋势的估计标准误差。巴德利和Turner(2000)的解释和例子。

Given a point pattern dataset, we may fit a point process model to the data using the  model-fitting algorithm ppm. This returns an object of class "ppm" representing  the fitted point process model (see ppm.object). The parameter estimates in this fitted model can be read off  simply by printing the ppm object. The spatial trend and conditional intensity of the  fitted model are evaluated using this function predict.ppm.
给定一个模式数据集,我们可以安装一个点过程模型的数据模型的拟合算法ppm。此方法返回一个类的对象"ppm"代表的拟合点过程模型(见ppm.object)。这拟合模型的参数估计可以读出简单地打印ppm对象。使用此功能predict.ppm的空间发展趋势和条件的拟合模型的强度进行评估。

The default action is to create a rectangular grid of points in the observation window of the data point pattern, and evaluate the spatial trend at these locations.
默认的操作是创建一个矩形网格点的数据点的观测窗口模式,并评估在这些位置上的空间趋势。

The argument type specifies the values that are computed:
参数type指定的值计算:

the “spatial trend” of the fitted model is evaluated at each required spatial location u.
在每个需要的空间位置u“空间潮流”的拟合模型进行评估。

the conditional intensity lambda(u,X) of the fitted model is evaluated at each required spatial location u, with respect to the data point pattern X.
的条件强度lambda(u,X)拟合模型评价在每个所需的空间位置u,对于数据点图案X。

the estimated (asymptotic) standard error of the fitted spatial trend is evaluated at each required spatial location u. This is available only for Poisson point process models.
在每个需要的空间位置u估计(渐进)的标准错误的安装空间趋势进行评估。这是仅适用于Poisson点过程模型。

Note that the “spatial trend” is the same as the intensity function if the fitted model object is a Poisson point process. However, if the model is not a Poisson process, then the “spatial trend” is the (exponentiated) first order potential and not the intensity of the process. [For example if we fit the stationary Strauss process with parameters beta and gamma, then the spatial trend is constant and equal to beta, while the intensity is a smaller value that is not easy to compute. ]
需要注意的是“空间潮流”是一样的亮度函数拟合模型object是一个Poisson点过程。但是,如果模型是不是一个泊松过程,然后在“空间潮流”(幂)一阶的潜力,而不是过程的强度。 [例如,如果我们适应的固定的施特劳斯过程参数beta和gamma,那么空间的趋势是不变的,等于beta,而强度是一个较小的值,这是不容易计算。 ]

The spatial locations where predictions are required, are determined by the (incompatible) arguments ngrid and locations.
空间位置的预测是必需的,确定的(不兼容)参数ngrid和locations。

If the argument ngrid is present, then predictions are performed at a rectangular  grid of locations in the window window.  The result of prediction will be a pixel image or images.
如果参数ngrid是本,然后预测在矩形网格的位置执行在窗口中的window。预测的结果将是一个像素的一个或多个图像。

If locations is present, then predictions will be performed at the spatial locations given by this dataset. These may be an arbitrary list of spatial locations, or they may be a rectangular grid.  The result of prediction will be either a numeric vector or a pixel image or images.
如果locations存在,那么预测将要执行此数据集的空间位置。这些可以是任意的空间的位置的列表,或者它们可以是一矩形网格。预测的结果将是一个数值向量或像素图像或图像。

If neither ngrid nor locations is given, then ngrid is assumed. The value of ngrid defaults to spatstat.options("npixel"), which is initialised to 128 when spatstat is loaded.
如果没有ngrid,也不locations,那么ngrid假设。 ngrid默认值spatstat.options("npixel"),这是初始化为128,当spatstat被加载。

The argument locations may be a point pattern, a data frame or a list specifying arbitrary locations; or it may be a binary image mask (an object of class "owin" with type "mask") specifying (a subset of) a rectangular grid of locations.
的参数locations可能是一个点的模式,一个数据框,或一个列表,指定任意位置,或者它可能是一个二进制图像掩码(类的一个对象"owin"型"mask")指定(一个子集)的位置的矩形网格。

If locations is a point pattern (object of class "ppp"), then prediction will be performed at the points of the point pattern. The result of prediction will be a vector of predicted values, one value for each point. If the model is a marked point process, then locations should be a marked point pattern, with marks of the same kind as the model; prediction will be performed at these marked points. The result of prediction will be a vector of predicted values, one value for each (marked) point.
locations如果点模式(类的对象"ppp"),然后将在该点的点模式进行预测。预测的结果将是一个矢量的预测值,对每个点的一个值。如果该模型是一个显着的点进程,然后locations应是一个显着的点图案,带有标记的相同种类的模型,预测将要执行在这些标记点。预测的结果将是一个矢量的预测值,为每个点(标记)的一个值。

If locations is a data frame or list, then it must contain vectors locations$x and locations$y specifying the x,y coordinates of the prediction locations. Additionally, if the model is a marked point process, then locations must also contain a factor locations$marks specifying the marks of the prediction locations. These vectors must have equal length. The result of prediction will be a vector of predicted values, of the same length.
locations如果是一个数据框或列表,那么它必须包含向量locations$x和locations$y指定x,y的预测位置的坐标。此外,如果该模型是一个显着的点过程,那么locations还必须包含的一个因素locations$marks指定的预测位置的标记。这些向量必须具有相同的长度。预测的结果将是一个矢量的预测值的,具有相同的长度。

If locations is a binary image mask, then prediction will be performed at each pixel in this binary image where the pixel value is TRUE (in other words, at each pixel that is inside the window). If the fitted model is an unmarked point process, then the result of prediction will be an image. If the fitted model is a marked point process, then prediction will be performed for each possible value of the mark at each such location, and the result of prediction will be a  list of images, one for each mark value.
如果locations是一个二进制图像掩模,然后预测将在每个像素执行在这个二进制图像的像素值是TRUE(换句话说,在每个像素处,是在窗口内)。如果拟合模型是一个没有标记的点,然后预测的结果将是一个图像。如果拟合模型是一个显着的点进程,然后将被预测为每个可能的值的标记执行在每一个这样的位置,和预测的结果将是一个图像列表,一个用于每个标记值。

The argument covariates gives the values of any spatial covariates at the prediction locations. If the trend formula in the fitted model  involves spatial covariates (other than the Cartesian coordinates x, y) then covariates is required.
参数covariates给任何空间的协变量的预测位置的值。如果这一趋势拟合模型公式涉及到空间的协变量(在直角坐标系以外x,y),然后covariates需要。

The format and use of covariates are analogous to those of the argument of the same name in ppm. It is either a data frame or a list of images.
的格式和使用covariates类似的参数中的同名ppm。它要么是一个数据框或一个图像列表。

If covariates is a list of images, then the names of the entries should correspond to the names of covariates in the model formula trend. Each entry in the list must be an image object (of class "im", see im.object). The software will look up the pixel values of each image at the quadrature points.
如果covariates是一个图像列表中的条目的名称,然后对应的协变量的模型公式trend的名称。列表中的每个条目必须是一个图像对象(类"im",看到im.object)。该软件将查找每个图像的像素值的正交点。

If covariates is a data frame, then the ith row of covariates is assumed to contain covariate data for the ith location. When locations is a data frame, this just means that each row of covariates contains the covariate data for the location specified in the corresponding row of locations. When locations is a binary image mask, the row covariates[i,] must correspond to the location x[i],y[i] where x = as.vector(raster.x(locations)) and y = as.vector(raster.y(locations)).
如果covariates是一个数据框,然后i行的第covariates被假定为i个位置包含协变量的数据。当locations是一个数据框,这也就意味着,每行covariates包含协变量数据在相应的行locations指定的位置。当locations是一个二进制图像屏蔽,行covariates[i,]必须符合的位置x[i],y[i]x = as.vector(raster.x(locations))和y = as.vector(raster.y(locations))。

Note that if you only want to use prediction in order to generate a plot of the predicted values, it may be easier to use plot.ppm which calls this function and plots the results.
请注意,如果你只是想使用,以产生一个图的预测值的预测,它可能是更容易使用plot.ppm调用该函数和图的结果。


值----------Value----------

If locations is given and is a data frame: a vector of predicted values for the spatial locations (and marks, if required) given in locations.
如果locations是给定的,并且是一个数据框:一个矢量的预测值的空间位置(和标志,如果需要的话)中给出locations。

If ngrid is given, or if locations is given and is a binary image mask: If object is an unmarked point process, the result is a pixel image object (of class "im", see im.object) containing the predictions.  If object is a multitype point process, the result is a list of pixel images, containing the predictions for each type at the same grid of locations.
ngrid如果,或locations是一个二进制图像屏蔽:如果object是一个没有标记的点过程,结果是一个像素的图像对象(类<X >,"im")的预测。如果im.object是一个多类型的点的过程,其结果是在同一网格的位置的像素的图像的列表,包含为每个类型的预测。

The &ldquo;predicted values&rdquo; are either values of the spatial trend (if type="trend"), values of the conditional intensity (if type="cif" or type="lambda"), or estimates of standard error for the fitted spatial trend (if type="se").
“预测值”值的空间趋势(如果type="trend"),有条件的强度值(如果type="cif"或type="lambda"),或标准错误估计的拟合空间趋势(如果type="se")。


警告----------Warnings----------

The current implementation invokes predict.glm so that prediction is wrong if the trend formula in object involves terms in ns(), bs() or poly(). This is a weakness of predict.glm itself!
目前的实现调用predict.glm“这样的预测是错误的,如果这种趋势公式object涉及ns(),bs()或poly()。这是一个的predict.glm本身的弱点!

Error messages may be very opaque, as they tend to come from deep in the workings of  predict.glm. If you are passing the covariates argument and the function crashes, it is advisable to start by checking that all the conditions  listed above are satisfied.
错误消息可能是非常不透明的,因为他们往往来自深的运作predict.glm。如果你是通过covariates参数和功能崩溃,最好是开始检查上面列出的所有条件满足。


(作者)----------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>




参考文献----------References----------

Practical maximum pseudolikelihood for spatial point patterns. Australian and New Zealand Journal of Statistics 42 (2000) 283&ndash;322.
Approximating point process likelihoods with GLIM. Applied Statistics 41 (1992) 31&ndash;38.

参见----------See Also----------

ppm, ppm.object, plot.ppm, print.ppm, fitted.ppm, spatstat.options
ppm,ppm.object,plot.ppm,print.ppm,fitted.ppm,spatstat.options


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


  data(cells)
  
  m <- ppm(cells, ~ polynom(x,y,2), Strauss(0.05))
  trend <- predict(m, type="trend")
  ## Not run: [#不运行:]
  image(trend)
  points(cells)
  
## End(Not run)[#(不执行)]
  cif <- predict(m, type="cif")
  ## Not run: [#不运行:]
  persp(cif)
  
## End(Not run)[#(不执行)]
  data(japanesepines)
  mj <- ppm(japanesepines, ~harmonic(x,y,2))
  se <- predict(mj, type="se")

  # prediction at arbitrary locations[预测在任意位置]
  predict(mj, locations=data.frame(x=0.3, y=0.4))

  X <- runifpoint(5, as.owin(japanesepines))
  predict(mj, locations=X)
  predict(mj, locations=X, type="se")

  # multitype[多类型]
  data(amacrine)
  ma <- ppm(amacrine, ~marks,
     MultiStrauss(c("off","on"),matrix(0.06, 2, 2)))
  Z <- predict(ma)
  Z <- predict(ma, type="cif")
  predict(ma, locations=data.frame(x=0.8, y=0.5,marks="on"), type="cif")

  

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-6-16 16:24 , Processed in 0.027987 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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