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

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

[复制链接]
发表于 2012-10-1 15:09:06 | 显示全部楼层 |阅读模式
oecosimu(vegan)
oecosimu()所属R语言包:vegan

                                         Null Models for Biological Communities
                                         空模型的生物群落

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

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

Null models generate random communities with different criteria to study the significance of nestedness or other community patterns. The function only simulates binary (presence/absence) models with constraint for total number of presences, and optionally for numbers of species and/or species frequencies.
空模型生成随机的社区有不同的标准来研究的意义的嵌套性或其他社区模式。该函数仅模拟二进制(存在/不存在)模型约束存在总数,和任选的物种和/或物种的频率的数字。


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


oecosimu(comm, nestfun, method, nsimul = 99, burnin = 0, thin = 1,
   statistic = "statistic", alternative = c("two.sided", "less", "greater"),
   ...)
commsimulator(x, method, thin=1)
## S3 method for class 'oecosimu'
as.ts(x, ...)
## S3 method for class 'oecosimu'
as.mcmc(x)
## S3 method for class 'oecosimu'
density(x, ...)
## S3 method for class 'oecosimu'
densityplot(x, data, xlab = "Simulated", ...)



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

参数:comm
Community data.
社区数据。


参数:x
Community data for commsimulator, or an oecosimu result object for as.ts, as.mcmc, density and  densityplot.
社区数据commsimulator,或oecosimu as.ts对象的结果,as.mcmc,density和densityplot。


参数:nestfun
Function to analyse nestedness. Some functions are provided in vegan, but any function can be used if it accepts the community as the first argument, and returns either a plain number or the result in list item with the name defined in argument statistic. See Examples for defining your own functions.
功能分析的嵌套。某些功能在vegan,但任何函数都可以使用,如果它接受社会的第一个参数,并返回一个简单的数字或结果列表中的项目的名称中定义的参数statistic 。示例,请参见定义自己的功能。


参数:method
Null model method. See details.
空模型方法。查看详细信息。


参数:nsimul
Number of simulated null communities.
模拟空社区的数量。


参数:burnin
Number of null communities discarded before proper analysis in sequential methods "swap" and "tswap".
在连续的方法,正确的分析之前丢弃的空社区"swap"和"tswap"。


参数:thin
Number of discarded null communities between two evaluations of nestedness statistic in sequential methods "swap" and "tswap".
社区两次评估之间的嵌套性统计,在连续的方法被丢弃的空数"swap"和"tswap"。


参数:statistic
The name of the statistic returned by nestedfun  
统计信息的名称,返回的nestedfun


参数:alternative
a character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater" or "less". Please note that the p-value of two-sided test is approximately two times higher than in the corresponding one-sided test ("greater" or "less" depending on the sign of the difference).
一个字符串,指定其他假设,必须有一个"two.sided"(默认),"greater"或"less"。请注意,p-双面测试值是在相应的片面测试的约2倍以上("greater"或"less"根据的符号的差别)。


参数:data
Ignored argument of the generic function.
忽略的通用函数的参数。


参数:xlab
Label of the x-axis.
标签的x轴。


参数:...
Other arguments to functions.
其他函数的参数。


Details

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

Function oecosimu is a wrapper that evaluates a nestedness statistic using function given by nestfun, and then simulates a series of null models using commsimulator or other functions (depending on method argument), and evaluates the statistic on these null models. The vegan packages contains some nestedness functions that are described separately (nestedchecker, nesteddisc, nestedn0, nestedtemp), but many other functions can be used as long as they are meaningful with binary or quantitative community models.  An applicable function must return either the statistic as a plain number, or as a list element "statistic" (like chisq.test), or in an item whose name is given in the argument statistic.  The statistic can be a single number (like typical for a nestedness index), or it can be a vector. The vector indices can be used to analyse site (row) or species (column) properties, see treedive for an example. Raup-Crick index (raupcrick) gives an example of using a dissimilarities index.
函数oecosimu是一个包装,一个嵌套性进行评估统计使用nestfun,函数,然后模拟了一系列的零模型使用commsimulator或其他功能(根据方法的参数),并评估这些零模型的统计。 vegan包包含了一些的嵌套性功能,现分别叙述(nestedchecker,nesteddisc,nestedn0,nestedtemp),但许多其他的功能可以使用,只要,他们是有意义的与二进制或定量社区模式。适用的统计函数必须返回一个简单的数字,或作为一个列表中的元素"statistic"(如chisq.test)的项目,或在其名称中给出的参数statistic。统计数据可以是一个单一的数字(如典型的嵌套性指数),或它可以是一个矢量。矢量指数可以用来分析网站(行)或物种(列)的属性,treedive的一个例子。劳普克里克指数(raupcrick)给出了一个示例使用一个不同点指数。

Function commsimulator implements binary (presence/absence)  null models for community composition. The implemented models are r00 which maintains the number of presences but fills these anywhere so that neither species (column) nor site (row) totals are preserved. Methods r0, r1 and r2 maintain the site (row) frequencies. Method r0 fills presences anywhere on the row with no respect to species (column) frequencies, r1 uses column marginal  frequencies as probabilities, and r2 uses squared column sums. Methods r1 and r2 try to simulate original species frequencies, but they are not strictly constrained. All these methods are reviewed by Wright et al. (1998). Method c0 maintains species frequencies, but does not honour site (row) frequencies (Jonsson 2001).
函数commsimulator实现二进制文件(有/无)群落组成的空模型。实现的模型是r00保持的存在,但填充任何地方,保留,无论是品种(列)或网站(行)合计数。方法r0,r1和r2维护网站(行)的频率。方法r0填充的存在,不尊重物种(列)的频率,r1使用列边缘频率的概率,和r2使用方列和行上的任何地方。方法r1和r2尝试模拟原种频率,但他们都没有严格的限制。所有这些方法都Wright等人审阅。 (1998年)。方法c0保持物种的频率,但,不贵网站(行)频率(琼森2001年)。

The other methods maintain both row and column frequencies. Methods swap and tswap implement sequential methods, where the matrix is changed only little in one step, but the changed matrix is used as an input if the next step. Methods swap and tswap inspect random 2x2 submatrices and if they are checkerboard units, the order of columns is swapped. This changes the matrix structure, but does not influence marginal sums (Gotelli & Entsminger 2003). Method swap inspects submatrices so long that a swap can be done. Mikl贸s & Podani (2004) suggest that this may lead into biased sequences, since some columns or rows may be more easily swapped, and they suggest trying a fixed number of times and doing zero to many swaps at one step. This method is implemented by method tswap or trial swap. Function commsimulator makes only one trial swap in time (which probably does nothing), but oecosimu estimates how many submatrices are expected before finding a swappable checkerboard, and uses that ratio to thin the results, so that on average one swap will be found per step of tswap.  However, the checkerboard frequency probably changes during swaps, but this is not taken into account in estimating the thin.  One swap still changes the matrix only little, and it may be useful to  thin the results so that the statistic is only evaluated after burnin steps (and thinned).
的其他方法,维持两个行和列的频率。方法swap和tswap执行的顺序的方法,其中矩阵只有很少的改变在一个步骤中,但改变的矩阵被用作下一步骤的输入,如果。方法swap和tswap检查随机2x2的子矩阵,如果他们是棋盘单位,列的顺序进行交换。这改变了基质结构,但并不影响边际的款项(戈泰利&Entsminger 2003)。方法swap检查子矩阵这么长时间可以做一个交换。米克洛什&Podani(2004)表明,这可能会导致成偏置序列,因为一些列或行可以更容易地交换,他们建议尝试一个固定的次数和在一个步骤中的许多掉期做零。此方法实现的方法tswap或试用交换。函数commsimulator交换的时间只有一个试验(这很可能什么也不做),但oecosimu估计有多少子矩阵预计将在找到可更换的棋盘,并使用该比瘦的结果,因此,平均一个交换会发现每一步的tswap。然而,棋盘频率可能掉期的变化过程中,但是这还没有考虑估计thin。一个交换仍然只有很少的改变矩阵,它可能是有用的结果,使瘦的统计评估后,burnin步骤(和thin NED)。

Methods quasiswap and backtracking are not sequential, but each call produces a matrix that is independent of previous matrices, and has the same marginal totals as the original data. The recommended method is quasiswap which is much faster because it is implemented in C. Method backtracking is provided for comparison, but it is so slow that it may be dropped from future releases of vegan (or also implemented in C). Method quasiswap (Mikl贸s & Podani 2004) implements a method where matrix is first filled  honouring row and column totals, but with integers that may be larger than one. Then the method inspects random 2x2 matrices and performs a quasiswap on them. Quasiswap is similar to ordinary swap, but it also can reduce numbers above one to ones maintaining marginal totals. Method backtracking implements a filling method with constraints both for row and column frequencies (Gotelli & Entsminger 2001). The matrix is first filled randomly using row and column frequencies as probabilities. Typically row and column sums are reached before all incidences are filled in. After that begins “backtracking”, where some of the points are removed, and then filling is started again, and this backtracking is done so may times that all incidences will be filled into matrix. The quasiswap method is not sequential, but it produces a random incidence matrix with given marginal totals.
方法quasiswap和backtracking是不连续的,但每个呼叫产生一个矩阵,它是独立的先前的矩阵,并具有相同的边际作为原始数据的总数。推荐的方法是quasiswap这是更快的,因为它是在C.法实施backtracking,以资比较,但它是如此缓慢,它可能是未来的版本的vegan的下降至(或用C实现的)。方法quasiswap(米克洛什&Podani 2004),实现了一种方法,其中矩阵首先填充兑现的行和列总计,但与,可以是大于1的整数。然后用什么方法检查随机2x2矩阵,对他们进行quasiswap。 Quasiswap是普通掉期类似,但它也可以减少上面的数字的保持边际总和。方法backtracking实现了一个填充方法与约束既为行和列的频率(戈泰利&Entsminger 2001)。矩阵的第一行和列的频率概率充满随机。典型的行和列的金额达到之前,所有不良反应的发生率是充满之后,开始“回溯”,其中的一些观点被删除,然后再次开始填充,这种回溯是这样做的所有发病率的5倍,将填充到矩阵。 quasiswap方法是不连续的,但它会产生一个随机的关联矩阵,与给定的边缘总数。

Function as.ts transforms the simulated results of sequential methods into a time series or a ts object. This allows using analytic tools for time series in studying the sequences (see examples). Function as.mcmc transforms the simulated results of sequential methods into an mcmc object of the coda package. The coda package provides functions for the analysis of stationarity, adequacy of sample size, autocorrelation, need of burn-in and much more for sequential methods. Please consult the documentation of coda package.
函数as.ts顺序的方法将模拟的结果为一个时间系列或ts对象的。这允许使用的时间序列研究序列分析工具(参见示例)。功能as.mcmc转换成mcmc对象coda包的顺序方法的模拟结果。 coda包提供了平稳的分析功能,充足的样本量,自相关,需要的老化和更连续的方法。请咨询coda包的文档。

Function density provides an interface to the standard density function for the simulated values. Function densityplot is an interface to the densityplot function of the lattice package. The density can be used meaningfully only for single statistics and must be plotted separately. The densityplot function can handle multiple statistics, and it plots the results directly. In addition to the density, the densityplot also shows the observed value of the statistic (provided it is within the graph limits). The densityplot function is defined as a generic function in the lattice package and you must either load the lattice library before calling densityplot, or use the longer form densityplot.oecosimu when you first time call the function.
函数density提供了一个接口标准density功能的模拟值。功能densityplot是densityplot功能lattice包的接口。 density可以用得其所仅适用于单统计,必须单独绘制。 densityplot函数可以处理多个统计量,并绘制了直接的结果。 densityplot在除了的密度,还示出的统计信息(它的图形范围内)的观测值。 densityplot函数被定义为一个泛型函数lattice包,您必须加载前调用lattice,densityplot库或使用更长的形式densityplot.oecosimu “”当你第一次调用该函数。

As a result of method = "r2dtable" in oecosimu, quantitative community null models are used to evaluate the statistic. This setting uses the r2dtable function to generate random matrices with fixed row and column totals (hypergeometric distribution). This null model is used in diversity partitioning function (see adipart).
由于method = "r2dtable"中oecosimu,定量社区空模型被用来评估统计。此设置使用r2dtable功能的产生固定的行和列的总访问量超几何分布的随机矩阵。本零模型采用的是多样性的分区函数(见adipart“)。

The method argument can be a function with first argument taking the  community matrix, and optionally with burnin and thin argument. The function must return a matrix-like object with same dimensions. But be careful, blindly applying permuted matrices for null model testing can be dangerous.
method参数可以是一个函数的第一个参数的社区矩阵,并选择性地与burnin和thin参数。该函数必须返回一个类似矩阵的对象具有相同的尺寸。但要小心,盲目进行置换矩阵为空模型试验可能是危险的。


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

Function oecosimu returns the result of nestfun added with a component called oecosimu. The oecosimu component contains the simulated values of the statistic (item simulated), the name of the method, P value (with given alternative), z-value of the statistic based on simulation (also known as standardized effect size), and the mean of simulations.  
功能oecosimu返回的结果nestfun添加一种成分叫做oecosimu。 oecosimu组件包含的统计(项目simulated)method,P这个值的名称(模拟值与给定的alternative) z值基于仿真的统计(也被称为标准化的效果大小),平均的模拟。


注意----------Note----------

Functions commsimulator and oecosimu do not have default nestfun nor default method, because there is no clear natural choice. If you use these methods, you must be able to choose your own strategy. The choice of nestedness index is difficult because the functions seem to imply very different concepts of structure and randomness. The choice of swapping method is also problematic. Method r00 has some heuristic value of being really random. However, it produces null models which are different from observed communities in most respects, and a “significant” result may simply mean that not all species are equally common (r0 is similar with this respect). It is also difficult to find justification for r2. The methods maintaining both row and column totals only study the community relations, but they can be very slow. Moreover, they regard marginal totals as constraints instead of results of occurrence patterns. You should evaluate timings in small trials (one cycle) before launching an extensive simulation. One swap is fast, but it changes data only little, and you may need long burnin and strong thinning in large matrices. You should plot the simulated values to see that they are more or less stationary and there is no trend. Method quasiswap is implemented in C and it is much faster than backtrack.  Method backtrack may be removed from later releases of vegan because it is slow, but it is still included for comparison.
功能commsimulator和oecosimu没有默认nestfun也默认method,因为目前还没有明确的自然选择。如果您使用这些方法,你必须能够选择自己的策略。嵌套性指数的选择是困难的,因为功能似乎暗示非常不同的概念,结构和随机性。交换方法的选择也存在问题。方法r00有一定的启发是真正的随机值。然而,它产生的零模型在很多方面,从观察到的社区是不同的,一个“显着”的结果可能仅仅意味着,并非所有的物种都是同样常见(r0这方面是相似的)。它也很难找到理由r2。保持双方的行和列的数量,只研究社会关系,但他们可能会很慢的方法。此外,他们认为边际总数的制约因素,而不是结果的出现模式。开展广泛的模拟之前,您应该评估在小规模试验的时间(一个周期)。一个交换速度快,但它只有很少的更改数据,您可能需要长burnin和强大的thin宁在大型矩阵。你应该绘制的模拟值看,他们或多或少固定,没有趋势。方法quasiswap是用C实现的,它是速度远远超过backtrack。方法backtrack可能会被删除从更高版本的vegan因为它是缓慢的,但它仍然是进行比较。

If you wonder about the name of oecosimu, look at journal
如果你想知道的名称oecosimu,看杂志


(作者)----------Author(s)----------


Jari Oksanen



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

null model analysis: rethinking the knight's tour. Oecologia 129, 281–291.
analysis. Ecology 84, 532–535.
nestedness in species assemblages. Oecologia 127, 309–313.
matrices: comments and new algorithms. Ecology 85, 86–92.
W. (1998). A comparative analysis of nested subset patterns of species composition. Oecologia 113, 1–20.

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

r2dtable generates table with given marginals but with entries above one. Functions permatfull and permatswap generate Null models for count data. Function rndtaxa (labdsv package) randomizes a community table. See also nestedtemp (that also discusses other nestedness
r2dtable生成表与给定的边缘人,但与上述1项。功能permatfull和permatswap产生空模型,用于计数数据。功能rndtaxa(labdsv包)随机化社区的表。 nestedtemp(即还讨论了其他的嵌套


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


## Use the first eigenvalue of correspondence analysis as an index[#使用索引的第一特征值对应分析]
## of structure: a model for making your own functions.[结构:一个模型制作自己的功能。]
data(sipoo)
out <- oecosimu(sipoo, decorana, "swap", burnin=100, thin=10, statistic="evals")
out
## Inspect the swap sequence as a time series object[检查交换作为一个时间序列对象序列]
plot(as.ts(out))
lag.plot(as.ts(out))
acf(as.ts(out))
## Density plot: needs lattice[需要点阵密度图:]
require(lattice)
densityplot(out, as.table = TRUE)
## Use quantitative null models to compare[使用定量的空模型比较]
## mean Bray-Curtis dissimilarities[#意味着布雷柯蒂斯相异。]
data(dune)
meandist <- function(x) mean(vegdist(x, "bray"))
mbc1 <- oecosimu(dune, meandist, "r2dtable")
mbc1
## Define a custom function that shuffles[#定义一个自定义函数洗牌]
## cells in each rows[#单元在每行]
f <- function(x) {
    apply(x, 2, function(z) sample(z, length(z)))
}
mbc2 <- oecosimu(as.matrix(dune), meandist, f)
mbc2

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-27 02:40 , Processed in 0.027196 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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