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

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

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

                                        Kolmogorov-Smirnov Test for Point Process Model
                                         Kolmogorov-Smirnov检验点过程模型

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

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

Performs a Kolmogorov-Smirnov test of goodness-of-fit of a Poisson point process model. The test compares the observed and predicted distributions of the values of a spatial covariate.
适合的泊松点过程模型善良的执行Kolmogorov-Smirnov检验。该试验比较的观察和预测的空间协变量的值的分布。


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


kstest(...)
## S3 method for class 'ppp'
kstest(X, covariate, ..., jitter=TRUE)
## S3 method for class 'ppm'
kstest(model, covariate, ..., jitter=TRUE)
## S3 method for class 'slrm'
kstest(model, covariate, ..., modelname=NULL, covname=NULL)



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

参数:X
A point pattern (object of class "ppp").  
点模式(类的对象"ppp")。


参数:model
A fitted point process model (object of class "ppm") or fitted spatial logistic regression (object of class "slrm").  
已安装点过程模型(对象类"ppm")或装空间Logistic回归(类的对象"slrm")。


参数:covariate
The spatial covariate on which the test will be based. A function, a pixel image (object of class "im"), a list of pixel images, or one of the characters "x" or "y" indicating the Cartesian coordinates.  
测试将根据空间的协变量。一个函数,一个像素的图像(类的对象"im"),一个像素的图片,或一个字符列表"x"或"y"表示在直角坐标系。


参数:...
Arguments passed to ks.test to control the test.  
参数传递给ks.test控制测试。


参数:jitter
Logical flag. If jitter=TRUE, values of the covariate will be slightly perturbed at random, to avoid tied values in the test.  
逻辑标志。如果jitter=TRUE,协变量的值会略有随机扰动,在测试中,以避免重复值。


参数:modelname,covname
Character strings giving alternative names for model and covariate to be used in labelling plot axes.  
字符串替代名称model和covariate中使用的标签图轴。


Details

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

These functions perform a goodness-of-fit test of a Poisson point process model fitted to point pattern data. The observed distribution of the values of a spatial covariate at the data points, and the predicted distribution of the same values under the model, are compared using the Kolmogorov-Smirnov test.
这些函数执行一个善良的配点模式数据的泊松点过程模型的拟合优度检验。空间协变量的数据点,并根据该模型的相同的值的预测分布,所观察到的分布的值进行比较使用Kolmogorov-Smirnov检验。

The function kstest is generic, with methods for point patterns ("ppp"), point process models ("ppm") and spatial logistic regression models ("slrm").
函数kstest是通用的,点模式("ppp"),点过程模型("ppm")和空间Logistic回归模型("slrm")的方法。

If X is a point pattern dataset (object of class "ppp"), then kstest(X, ...) performs a goodness-of-fit test of the uniform Poisson point process (Complete Spatial Randomness, CSR) for this dataset. For a multitype point pattern, the uniform intensity is assumed to depend on the type of point (sometimes called Complete Spatial Randomness and Independence, CSRI).
如果X是一个点图案集(类的对象"ppp"),然后kstest(X, ...)执行一个善良的拟合优度检验的统一Poisson点过程(完整的空间随机性,CSR)此数据集。一个多类型的点模式,被假定为均匀的强度取决于点的类型(有时也被称为完整的空间随机性和独立性,CSRI)。

If model is a fitted point process model (object of class "ppm") then kstest(model, ...) performs a test of goodness-of-fit for this fitted model. In this case, model should be a Poisson point process.
model如果是一个拟合点过程模型(类的对象"ppm")然后kstest(model, ...)善良的适合这个模型拟合进行测试。在这种情况下,model应该是一个泊松点过程。

If model is a fitted spatial logistic regression (object of class "slrm") then kstest(model, ...) performs a test of goodness-of-fit for this fitted model.
如果model是一个厨房的空间Logistic回归(类的对象"slrm")然后kstest(model, ...)善良的适合这个模型拟合进行测试。

The test is performed by comparing the observed distribution of the values of a spatial covariate at the data points, and the predicted distribution of the same covariate under the model, using the classical Kolmogorov-Smirnov test. Thus, you must nominate a spatial covariate for this test.
进行试验所观察到的分布的值空间协变量的数据点,和相同的协变量模型下的预测分布进行比较,采用经典的Kolmogorov-Smirnov测试。因此,你必须提名本次测试的协变量的空间。

If X is a point pattern that does not have marks, the argument covariate should be either a function(x,y) or a pixel image (object of class "im" containing the values of a spatial function, or one of the characters "x" or "y" indicating the Cartesian coordinates. If covariate is an image, it should have numeric values, and its domain should cover the observation window of the model. If covariate is a function, it should expect two arguments x and y which are vectors of coordinates, and it should return a numeric vector of the same length as x and y.
如果X是一个没有标记的点模式,参数covariate应该是一个function(x,y)或像素图像(类的对象"im"包含的值,空间功能,或一个字符"x"或如果"y" covariate表示在直角坐标系。是一个图像,它应该有数值,和其领域覆盖的观测窗口model如果covariate是一个函数,它应该期望两个参数x和y这是向量的坐标,它应该返回一个数值向量的长度相同x和y。

If X is a multitype point pattern, the argument covariate can be either a function(x,y,marks), or a pixel image, or a list of pixel images corresponding to each possible mark value, or one of the characters "x" or "y" indicating the Cartesian coordinates.
如果X是一个多类型的点模式,参数covariate的function(x,y,marks),或像素图像,或像素的图像,对应于每一个可能的标记值的列表,或一个字符"x"或"y"表示在直角坐标系。

First the original data point pattern is extracted from model. The values of the covariate at these data points are collected.
首先,原始数据点模式提取model。 covariate在这些数据点的值被收集。

The predicted distribution of the values of the covariate under the fitted model is computed as follows. The values of the covariate at all locations in the observation window are evaluated, weighted according to the point process intensity of the fitted model, and compiled into a cumulative distribution function F using ewcdf.
的covariate在拟合model下的值的预测分布的计算方法如下。 covariate在观察窗口中的所有位置的值进行评估,根据拟合模型的点过程强度进行加权,并编译成的累积分布函数F使用ewcdf。

The probability integral transformation is then applied: the values of the covariate at the original data points are transformed by the predicted cumulative distribution function F into numbers between 0 and 1. If the model is correct, these numbers are i.i.d. uniform random numbers. The Kolmogorov-Smirnov test of uniformity is applied using ks.test.
的概率积分变换,然后应用:covariate的值,在被转换的原始数据点是由所述被预测的累积分布函数F到0和1之间的数字。如果模型是正确的,这些数字是独立同分布均匀分布的随机数。 Kolmogorov-Smirnov检验的均匀性应用使用ks.test。

This test was apparently first described (in the context of spatial data) by Berman (1986). See also Baddeley et al (2005).
此试验,显然首先描述(空间数据的上下文中)者伯曼(1986)。巴德利等人(2005年)。

The return value is an object of class "htest" containing the results of the hypothesis test. The print method for this class gives an informative summary of the test outcome.
返回值是一个类的对象"htest"包含的假设检验的结果。这一类的print方法的测试结果给出了一个翔实的总结。

The return value also belongs to the class "kstest" for which there is a plot method plot.kstest. The plot method displays the empirical cumulative distribution function of the covariate at the data points, and the predicted cumulative distribution function of the covariate under the model, plotted against the value of the covariate.
返回值也属于类"kstest"其中有一个图方法plot.kstest。 plot方法显示的经验的累积分布函数的协变量的数据点,和预测的累积分布函数的协变量模型下,绘制对的值的协变量。

The argument jitter controls whether covariate values are randomly perturbed, in order to avoid ties. If the original data contains any ties in the covariate (i.e. points with equal values of the covariate), and if jitter=FALSE, then  the Kolmogorov-Smirnov test implemented in ks.test will issue a warning that it cannot calculate the exact p-value. To avoid this, if jitter=TRUE each value of the covariate will be perturbed by adding a small random value. The perturbations are normally distributed with standard deviation equal to one hundredth of the range of values of the covariate. This prevents ties,  and the p-value is still correct. There is a very slight loss of power.
参数jitter控制是否协变量的值是随机扰动,为了避免关系。如果原始数据包含任何关系的协变量(即点与平等的协变量的值),如果jitter=FALSE,然后Kolmogorov-Smirnov检验实施ks.test会发出一个警告,它无法计算p价值。为了避免这种情况,如果jitter=TRUE每个值的协将加入一个小的随机值的扰动。的扰动通常分布标准偏差等于第一百的协变量的值的范围内。这可以防止关系,p价值仍然是正确的。有一个很轻微的功率损耗。


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

An object of class "htest" containing the results of the test. See ks.test for details. The return value can be printed to give an informative summary of the test.
类的一个对象"htest"包含的测试结果。见ks.test的详细信息。返回值可以打印的测试提供一个翔实的总结。

The value also belongs to the class "kstest" for which there is a plot method.
该值还属于类"kstest"其中有一个图方法。


警告----------Warning----------

The outcome of the test involves a small amount of random variability, because (by default) the coordinates are randomly perturbed to avoid tied values. Hence, if kstest is executed twice, the p-values will not be exactly the same. To avoid this behaviour, set jitter=FALSE.
测试的结果涉及少量的随机变异,因为(默认情况下)的坐标是随机扰动,以避免重复值。因此,如果kstest执行两次,p值将不会是完全一样的。为了避免这种行为,jitter=FALSE。


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

Residual analysis for spatial point processes. Journal of the Royal Statistical Society, Series B 67, 617&ndash;666.
Testing for spatial association between a point process and another stochastic process. Applied Statistics 35, 54&ndash;62.

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

plot.kstest, quadrat.test, bermantest, ks.test, ppm
plot.kstest,quadrat.test,bermantest,ks.test,ppm


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


   # real data: NZ trees[真正的数据:新西兰树]
   data(nztrees)

   # test of CSR using x coordinate[CSR的测试,使用的x坐标]
   kstest(nztrees, "x")

   # test of CSR using a function of x and y[使用x和y的函数的CSR的测试]
   fun <- function(x,y){2* x + y}
   kstest(nztrees, fun)

   # test of CSR using an image covariate[CSR的测试,使用图像协]
   funimage <- as.im(fun, W=as.owin(nztrees))
   kstest(nztrees, funimage)

   # fit inhomogeneous Poisson model and test[适合非齐次泊松模型和测试]
   model <- ppm(nztrees, ~x)
   kstest(model, "x")

   # synthetic data: nonuniform Poisson process[合成数据:不均匀的泊松过程]
   X <- rpoispp(function(x,y) { 100 * exp(x) }, win=square(1))

   # fit uniform Poisson process[符合统一的泊松过程]
   fit0 <- ppm(X, ~1)
   # fit correct nonuniform Poisson process[配合正确的不均匀泊松过程]
   fit1 <- ppm(X, ~x)

   # test wrong model[测试错误的模型]
   kstest(fit0, "x")
   # test right model[测试正确的模式]
   kstest(fit1, "x")

   # multitype point pattern[多类型的点模式]
   data(amacrine)
   kstest(amacrine, "x")
   yimage <- as.im(function(x,y){y}, W=as.owin(amacrine))
   kstest(ppm(amacrine, ~marks+y), yimage)

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-6-15 23:35 , Processed in 0.022120 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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