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

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

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

                                         Constrained Quadratic Ordination
                                         约束的二次排序

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

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

Random generation for constrained quadratic ordination (CQO).
(CQO)随机生成的约束二次协调。


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


rcqo(n, p, S, Rank = 1,
     family = c("poisson", "negbinomial", "binomial-poisson",
                "Binomial-negbinomial", "ordinal-poisson",
                "Ordinal-negbinomial", "gamma2"),
     EqualMaxima = FALSE, EqualTolerances = TRUE, ESOptima = FALSE,
     loabundance = if (EqualMaxima) hiabundance else 10,
     hiabundance = 100, sdlv = head(1.5/2^(0:3), Rank),
     sdOptima = ifelse(ESOptima, 1.5/Rank, 1) * ifelse(scalelv, sdlv, 1),
     sdTolerances = 0.25, Kvector = 1, Shape = 1,
     sqrt = FALSE, Log = FALSE, rhox = 0.5, breaks = 4,
     seed = NULL, Crow1positive = TRUE, xmat = NULL, scalelv = TRUE)



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

参数:n
Number of sites. It is denoted by n below.  
站点数量。它表示n下面。


参数:p
Number of environmental variables, including an intercept term.  It is denoted by p below. Must be no less than 1+R in value.  
环境变量,包括截距项的数目。它表示p下面。必须不低于1+R价值的。


参数:S
Number of species. It is denoted by S below.  
物种数量。它表示S下面。


参数:Rank
The rank or the number of latent variables or true dimension of the data on the reduced space. This must be either 1, 2, 3 or 4. It is denoted by R.  
该等级或潜变量或真实尺寸的减小的空间上的数据的数量。这必须是1,2,3或4。它表示R。


参数:family
What type of species data is to be returned. The first choice is the default. If binomial then a 0 means absence and 1 means presence. If ordinal then the breaks argument is passed into the breaks argument of cut. Note that either the Poisson or negative binomial distributions are used to generate binomial and ordinal data, and that an upper-case choice is used for the negative binomial distribution (this makes it easier for the user). If "gamma2" then this is the 2-parameter gamma distribution.      
要返回什么类型的物种数据。第一个选择是默认值。如果二项式一个0表示没有,1表示存在。如果序号,然后breaks参数传递到breaks的cut参数。请注意,泊松或负二项式分布使用以产生二项分布和序号的数据,和一个大写的选择用于负二项式分布(这使得它更容易为用户)。如果"gamma2"然后这2个参数的伽玛分布。


参数:EqualMaxima
Logical. Does each species have the same maxima? See arguments loabundance and hiabundance.  
逻辑。每一个物种是否具有相同的最大值?参见参数loabundance和hiabundance。


参数:EqualTolerances
Logical. Does each species have the same tolerance? If TRUE then the common value is 1 along every latent variable, i.e., all species' tolerance matrices are the order-R identity matrix.  
逻辑。每一个物种是否具有相同的误差吗?如果TRUE然后共同的价值是沿每个潜变量,即,所有物种的耐受性矩阵是为了R的的身份矩阵。


参数:ESOptima
Logical. Do the species have equally spaced optima? If TRUE then the quantity S^(1/R) must be an integer with value 2 or more. That is, there has to be an appropriate number of species in total. This is so that a grid of optimum values is possible in R-dimensional latent variable space in order to place the species' optima. Also see the argument sdTolerances.  
逻辑。同样的品种间隔最优解?如果TRUE然后的数量S^(1/R)必须是一个整数,值2个或更多。即,必须有适当数量的物种总。这是为了让一格的最佳值是可能的R维潜变量的空间,以便把该物种的最优解。另外的说法sdTolerances。


参数:loabundance, hiabundance
Numeric. These are recycled to a vector of length S. The species have a maximum between loabundance and hiabundance. That is, at their optimal environment, the mean abundance of each species is between the two componentwise values. If EqualMaxima is TRUE then loabundance and hiabundance must have the same values. If EqualMaxima is FALSE then the logarithm of the maxima are uniformly distributed between log(loabundance) and log(hiabundance).  
数字。这些再循环的矢量长度S。有一个最大的物种之间loabundance和hiabundance。也就是说,在其最佳环境中,每个物种的平均丰度为两个分量共值之间。如果EqualMaxima是TRUE然后loabundance和hiabundance必须有相同的价值观。如果EqualMaximaFALSE然后对数的最大值均匀分布在log(loabundance)和log(hiabundance)。


参数:sdlv
Numeric, of length R (recycled if necessary). Site scores along each latent variable have these standard deviation values. This must be a decreasing sequence of values because the first ordination axis contains the greatest spread of the species' site scores, followed by the second axis, followed by the third axis, etc.  
数字,长度R(回收如果必要的话)。沿每个潜变量得分的网站有这些标准偏差值。这必须是一个递减的序列的值,因为第一排序轴包含物种的网站的分数,然后由所述第二轴的最大传播的,随后的第三轴线,等


参数:sdOptima
Numeric, of length R (recycled if necessary). If ESOptima = FALSE then, for the rth latent variable axis, the optima of the species are generated from a normal distribution centered about 0. If ESOptima = TRUE then the S optima are equally spaced about 0 along every latent variable axis. Regardless of the value of ESOptima, the optima are then scaled to give standard deviation sdOptima[r].  
数字,长度R(回收如果必要的话)。如果ESOptima = FALSE然后,r日潜变量轴,该品种的最优解产生的正常分布集中,共有约0。如果ESOptima = TRUES最优解是等间隔的每一个隐变量轴沿约0。不管的ESOptima的价值,最优解,然后缩放,给标准差sdOptima[r]。


参数:sdTolerances
Logical. If EqualTolerances = FALSE then, for the rth latent variable, the species' tolerances are chosen from a normal distribution with mean 1 and standard deviation sdTolerances[r]. However, the first species y1 has its tolerance matrix set equal to the order-R identity matrix. All tolerance matrices for all species are diagonal in this function. This argument is ignored if EqualTolerances is TRUE, otherwise it is recycled to length R if necessary.  
逻辑。如果EqualTolerances = FALSE然后,r个潜变量,该物种的公差选择从正态分布,均值和标准差sdTolerances[r]。然而,第一种y1具有设置为等于其容许矩阵的顺序-R恒等矩阵。在这个函数中所有物种的所有公差矩阵对角线。此参数将被忽略,如果EqualTolerances是TRUE,否则将被回收长度R如果必要。


参数:Kvector
A vector of positive k values (recycled to length S if necessary) for the negative binomial distribution (see negbinomial for details). Note that a natural default value does not exist, however the default value here is probably a realistic one, and that for large values of μ one has Var(Y) = mu^2 / k approximately.  
积极k值的矢量(循环利用,以的长度S,如果有必要)为负二项分布(negbinomial)。但需要注意的是一个天然的默认值不存在,这里的默认值可能是一个现实的,而且μ1Var(Y) = mu^2 / k约大值。


参数:Shape
A vector of positive lambda values (recycled to length S if necessary) for the 2-parameter gamma distribution (see gamma2 for details).  Note that a natural default value does not exist, however the default value here is probably a realistic one, and that Var(Y) = mu^2 / lambda.  
积极lambda值的矢量(循环利用,以的长度S,如果有必要)2个参数的伽玛分布(gamma2)。需要注意的是一个天然的默认值不存在,但是这里的默认值可能是一个现实的,和Var(Y) = mu^2 / lambda。


参数:sqrt
Logical. Take the square-root of the negative binomial counts? Assigning sqrt = TRUE when family="negbinomial" means that the resulting species data can be considered very crudely to be approximately Poisson distributed. They will not integers in general but much easier (less numerical problems) to estimate using something like cqo(..., family="poissonff").  
逻辑。负二项式数的平方根?分配sqrt = TRUE如果family="negbinomial"是指产生的物种数据可以被认为是很粗暴约泊松分布。他们一般不是整数,但更容易(少数值的问题),估计使用类似cqo(..., family="poissonff")。


参数:Log
Logical. Take the logarithm of the gamma random variates? Assigning Log = TRUE when family="gamma2" means that the resulting species data can be considered very crudely to be approximately Gaussian distributed about its (quadratic) mean. The result is that it is much easier (less numerical problems) to estimate using something like cqo(..., family="gaussianff").  
逻辑。取对数的伽玛随机变数?分配Log = TRUE当family="gamma2"是指可以被认为是非常粗糙的近似高斯分布(二次)平均产生的物种数据。其结果是,它是非常容易(少数值问题),估计类似cqo(..., family="gaussianff")。


参数:rhox
Numeric, less than 1 in absolute value. The correlation between the environmental variables. The correlation matrix is a matrix of 1's along the diagonal and rhox in the off-diagonals. Note that each environmental variable is normally distributed with mean 0. The standard deviation of each environmental variable is chosen so that the site scores have the determined standard deviation, as given by argument sdlv.  
数值,小于1的绝对值。环境变量之间的相关性。的相关矩阵1的沿是一个矩阵的对角线和rhox在断开对角线。需要注意的是每个环境变量,正态分布,均值为0。每个环境变量的标准差选择,使该网站评分所确定的标准偏差,所给出的参数sdlv。


参数:breaks
If family is assigned an ordinal value then this argument is used to define the cutpoints. It is fed into the breaks argument of cut.  
如果family然后被分配一个序号值,这个参数是用来定义分割点。它被送入breaks参数cut。


参数:seed
If given, it is passed into set.seed. This argument can be used to obtain reproducible results. If set, the value is saved as the "seed" attribute of the returned value. The default will not change the random generator state, and return .Random.seed as "seed" attribute.  
如果给定的,它被传递到set.seed。这个参数可以被用来获得可重复的结果。如果设置"seed"属性的返回值,该值被保存为。默认不会改变的随机数生成器的状态,并返回.Random.seed "seed"属性。


参数:Crow1positive
See qrrvglm.control for details.  
见qrrvglm.control的详细信息。


参数:xmat
The n by  p-1 environmental matrix can be inputted.  
np-1环境介质的输入。


参数:scalelv
Logical. If FALSE the argument sdlv is ignored and no scaling of the latent variable values is performed.   
逻辑。如果FALSE的说法sdlv被忽略,并且不结垢的潜在变量的值进行。


Details

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

This function generates data coming from a constrained quadratic ordination (CQO) model. In particular, data coming from a species packing model can be generated with this function. The species packing model states that species have equal tolerances, equal maxima, and optima which are uniformly distributed over the latent variable space. This can be achieved by assigning the arguments ESOptima = TRUE, EqualMaxima = TRUE, EqualTolerances = TRUE.
这个函数生成的数据来自一个约束的二次排序(CQO)模型。特别是,数据来自一个物种堆积模型可以产生与此功能。该种包装模式状态,该品种具有相同的公差,等于最大值,最适均匀地分布在潜变量空间。这样就可以实现分配的参数ESOptima = TRUE,EqualMaxima = TRUE,EqualTolerances = TRUE。

At present, the Poisson and negative binomial abundances are generated first using loabundance and hiabundance, and if family is binomial or ordinal then it is converted into these forms.
目前,泊松和负二项式丰度产生的第一使用loabundance和hiabundance,和如果family是二项式或序号,然后它被转换成这些形式。

In CQO theory the n by p matrix X is partitioned into two parts X_1 and X_2. The matrix X_2 contains the "real" environmental variables whereas the variables in X_1 are just for adjustment purposes; they contain the intercept terms and other variables that one wants to adjust for when (primarily) looking at the variables in X_2. This function has X_1 only being a matrix of ones, i.e., containing an intercept only.
在CQO理论的np矩阵X被划分为两部分X_1和X_2。的矩阵X_2包含的“真实”的环境变量,而变量在X_1只是调整的目的,它们包含截距项和其他变量,要调整时(主要)在的变量X_2。此功能X_1只有一个的矩阵,即,只含截距。


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

A n by p-1+S data frame with components and attributes. In the following the attributes are labelled with double quotes.
Anp-1+S组件和属性数据框。在下面的属性都标有双引号。


参数:x2, x3, x4, ..., xp
The environmental variables. This makes up the n by p-1 X_2 matrix. Note that x1 is not present; it is effectively a vector of ones since it corresponds to an intercept term when cqo is applied to the data.  
环境变量。这使得np-1X_2矩阵。注意x1是不存在的,它的向量是有效的,因为它对应于当cqo被施加到数据的截距项。


参数:y1, y2, x3, ..., yS
The species data. This makes up the n by S matrix Y. This will be of the form described by the argument family.  
该物种的数据。这使得nS矩阵Y。这将是形式的说法family。


参数:"ccoefficients"
The p-1 by R matrix of constrained coefficients (or canonical coefficients). These are also known as weights or loadings.  
p-1R矩阵的约束系数(或规范的系数)。这些也被称为用作砝码或负荷。


参数:"formula"
The formula involving the species and environmental variable names. This can be used directly in the formula argument of cqo.  
该公式涉及的物种和环境变量的名字。这可以被用来直接在formula参数cqo。


参数:"logmaxima"
The S-vector of species' maxima, on a log scale. These are uniformly distributed between log(loabundance) and log(hiabundance).  
的的S向量物种的最大值,对数尺度。这些都均匀地分布在log(loabundance)和log(hiabundance)。


参数:"lv"
The n by R matrix of site scores. Each successive column (latent variable) has sample standard deviation equal to successive values of sdlv.  
nR矩阵的网站得分。每个连续的列(潜变量)样本标准差等于连续值sdlv。


参数:"eta"
The linear/additive predictor value.  
的线性/添加剂的预测中值。


参数:"optima"
The S by R matrix of species' optima.  
SR物种的最优解矩阵。


参数:"tolerances"
The S by R matrix of species' tolerances. These are the square root of the diagonal elements of the tolerance matrices (recall that all tolerance matrices are restricted to being diagonal in this function).  
S:R矩阵物种的公差。这些的公差矩阵的对角线元素的平方根(记得,所有公差矩阵被限制到在此函数中对角线)。

Other attributes are "break", "family", "Rank", "loabundance", "hiabundance", "EqualTolerances", "EqualMaxima", "seed" as used.
其他的属性是"break","family","Rank","loabundance","hiabundance","EqualTolerances","EqualMaxima","seed"为已使用。


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

This function is under development and is not finished yet. There may be a few bugs.
此功能正在开发中,尚未完成。可能有一些错误。

Yet to do: add an argument that allows absences to be equal to the first level if ordinal data is requested.
然而,做的事:添加一个参数,允许缺席等于第一级序请求数据。


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


T. W. Yee



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

A new technique for maximum-likelihood canonical Gaussian ordination. Ecological Monographs, 74, 685–701.
Constrained additive ordination. Ecology, 87, 203–213.
A theory of gradient analysis. Advances in Ecological Research, 18, 271–317.

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

cqo, qrrvglm.control, cut, binomialff, poissonff, negbinomial, gamma2, gaussianff.
cqo,qrrvglm.control,cut,binomialff,poissonff,negbinomial,gamma2,gaussianff。


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


# Example 1: Species packing model:[例1:种包装规格型号:]
n = 100; p = 5; S = 5
mydata = rcqo(n, p, S, ESOpt = TRUE, EqualMax = TRUE)
names(mydata)
(myform = attr(mydata, "formula"))
fit = cqo(myform, poissonff, mydata, Bestof = 3) # EqualTol = TRUE [EqualTol = TRUE]
## Not run: [#不运行:]
matplot(attr(mydata, "lv"), mydata[,-(1p-1))], col=1:S)
persp(fit, col=1:S, add = TRUE)
lvplot(fit, lcol=1:S, y = TRUE, pcol=1:S)  # The same plot as above[上述同积]

## End(Not run)[#(不执行)]

# Compare the fitted model with the 'truth'[比较合适的模型与“真相”]
ccoef(fit)  # The fitted model[拟合模型]
attr(mydata, "ccoefficients") # The 'truth'[“真相”]

c(apply(attr(mydata, "lv"), 2, sd), apply(lv(fit), 2, sd)) # Both values should be approx equal[这两个值应该大约等于]


# Example 2: negative binomial data fitted using a Poisson model:[例2:数据拟合负二项分布的泊松模型:]
n = 200; p = 5; S = 5
mydata = rcqo(n, p, S, fam="negbin", sqrt = TRUE)
myform = attr(mydata, "formula")
fit = cqo(myform, fam=poissonff, dat=mydata) # ITol = TRUE,[ITol = TRUE,]
## Not run: [#不运行:]
lvplot(fit, lcol=1:S, y = TRUE, pcol=1:S)
## End(Not run)[#(不执行)]
# Compare the fitted model with the 'truth'[比较合适的模型与“真相”]
ccoef(fit)  # The fitted model[拟合模型]
attr(mydata, "ccoefficients") # The 'truth'[“真相”]


# Example 3: gamma2 data fitted using a Gaussian model:[例3:GAMMA2数据拟合采用高斯模型:]
n = 200; p = 5; S = 3
mydata = rcqo(n, p, S, fam="gamma2", Log = TRUE)
fit = cqo(attr(mydata, "formula"), fam=gaussianff, dat=mydata) # ITol=TRUE,[ITol = TRUE,]
## Not run: [#不运行:]
matplot(attr(mydata, "lv"), exp(mydata[,-(1p-1))]), col=1:S) # 'raw' data[“原始”数据]
lvplot(fit, lcol=1:S, y=TRUE, pcol=1:S)  # Fitted model to transformed data[转换后的数据拟合模型]

## End(Not run)[#(不执行)]
# Compare the fitted model with the 'truth'[比较合适的模型与“真相”]
ccoef(fit)  # The fitted model[拟合模型]
attr(mydata, "ccoefficients") # The 'truth'[“真相”]

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-26 12:34 , Processed in 0.023146 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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