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

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

[复制链接]
发表于 2012-9-28 20:34:20 | 显示全部楼层 |阅读模式
projectn(Rramas)
projectn()所属R语言包:Rramas

                                         Demographic projections
                                         人口结构的预测

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

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

Make deterministic and stochastic demographic projections according to a transition matrix.
确定性和随机性的人口预测,根据转换矩阵。


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


projectn(v0, mat, matsd = NULL, estamb = FALSE, estdem = FALSE,
         equalsign = TRUE,stmat=NULL, fecundity1=TRUE,
        nrep = 1, time = 10, management=NULL, round=TRUE)
project1(v0, mat, matsd=NULL, estamb=FALSE, estdem=FALSE,
         equalsign=TRUE, stmat=NULL, fecundity1=TRUE)
estambi(mat, matsd, equalsign)
estdemo(v0,mat,stmat=NULL, fecundity1=TRUE)
## S3 method for class 'rmas'
plot(x, sum = TRUE, mean=FALSE, type="l", harvest=FALSE, ...)
## S3 method for class 'rmas'
summary(object, stage=NULL, harvest=FALSE,...)
## S3 method for class 'summary.rmas'
plot(x, ylim=NULL, col=NULL, xlab=NULL, ylab=NULL, main=NULL,...)




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

参数:v0
Vector with the initial abundance of each stage.
向量的每个阶段的初始丰度。


参数:mat
Transition matrix.
过渡矩阵。


参数:matsd
Matrix with the standard deviation of the probabilities in mat.
矩阵在mat的概率的标准偏差。


参数:estamb
Logical. Should environmental stochasticity be considered to projet the dynamics of the population?
逻辑。当环境随机性考虑以谟人口的动态?


参数:estdem
Logical. Should demographic stochasticity be employed to project the dynamics of the population?
逻辑。人口的随机性,预测人口的动态吗?


参数:equalsign
Logical. Should the environmental deviations have all the same sign and magnitude? See details section.
逻辑。如果环境差有相同的符号和大小吗?查看详细资料“部分中。


参数:stmat
Matrix indicating for each transition probability in mat which part (i.e. which proportion) should be considered resulting from  fecundity (and the rest will be considered resulting from survival). See details.  
每个转移概率矩阵,表示mat部分(即比例),应考虑从产卵量(其余的将被视为从生存)。查看详细信息。


参数:fecundity1
Logical. Should the first row of mat be considered exclusively as fecundities? See details
逻辑。如果第一行mat被认为是专为产卵量呢?查看详细资料


参数:nrep
Number of replications  to evaluate the effects of stochasticity.
重复数的随机性的影响进行评估。


参数:time
length of the demographic trajectory
长度的人口轨迹


参数:management
Vector (or matrix) of management actions to be applied each time step.      
向量(或矩阵)的管理行动,以适用于每一个时间步长。


参数:round
Logical. Should the projections be rounded to the next integer each time step (i.e. consider finite indiviuals)?  
逻辑。如果预测被舍入到下一个整数每一个时间步(即考虑有限indiviuals,)?


参数:object
An object of class rmas, i.e. resulting from projectn.
对象的类rmas,即从projectn。


参数:x
An object resulting from projectn or summary.rmas.
的对象产生projectn或summary.rmas。


参数:stage
Print only the trajectory of the stage called ...
打印只轨迹的阶段被称为...


参数:harvest
Logical. Should the harvest history be summarized or ploted instead of the population one?   
逻辑。如果收获的历史汇总或ploted的,而不是人口的一个吗?


参数:sum
Logical. If TRUE, print the trajectory of the whole population. If FALSE, print the individual trajectory of all stages.
逻辑。如果TRUE,打印整个人口的轨迹。如果FALSE,打印的个人轨迹的各个阶段。


参数:mean
Logical. If TRUE, print the mean trajectory of all replications. If FALSE, print all the replicated trajectories.
逻辑。如果TRUE,打印所有重复的平均轨迹。如果FALSE,打印所有复制的轨迹。


参数:type
Type of plot to represent the trajectories. By default, a line.  
图类型及其代表的轨迹。默认情况下,一条线。


参数:ylim
Vector with max and min values of the y (abundances) axis.  
向量的y轴(丰度)的最大值和最小值。


参数:col
Color or vector of colors to draw the trajectories.
颜色或矢量的颜色绘制的轨迹。


参数:xlab
Label for the x-axis.
出版商为x轴。


参数:ylab
Label for the y-axis.
出版商为y轴。


参数:main
Text to appear as title.
出现的文字作为标题。


参数:...
Other parameters passed to plot and other methods.
其他参数传递给图和其他方法。


Details

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

The function projectn makes demographic proyections by repetedly calling (as long as the time argument) to project1. If no environmental or demographic stochasticity is required, project1 will multiply the transition matrix mat by the vector of stage abundances.
的功能projectn使人口proyections,由repetedly调用(只要时间参数)project1的。如果没有环境和人口的随机性,project1就会大量繁殖的过渡矩阵mat阶段的丰度的向量。

If demographic stochasticity is required, project1 will call to estdemo function, that for each time will assign abundances to each stage based in sampling from both a binomial and a poisson distribution. Sampling from rbinom with probability mat[i,j] will assign  "survival" chances to each individual accounted for in the abundance vector, i.e. it would allow some of them to remain in the same stages (for transitions mat[i,i]) or to pass to another stage (for transitions mat[i,j]). Sampling from rpois with mean mat[i,j] will assign to each individual of stage[j] a random number of offspring of type stage[i].
如果人口的随机性,project1estdemo功能,每一次都会分配丰度的每一个阶段从一个二项分布,泊松分布的采样打检测。采样的概率mat[i,j] rbinom将分配到每一个人的丰度矢量占“生存”的机会,即如果让他们中的一些留在相同的阶段(转换mat[i,i])或传递到另一个阶段(转场mat[i,j]“)。取样rpois,平均mat[i,j]将分配给每一个人的stage[j]一个随机数,子孙的类型stage[i]。

In the current implementation there are 3 options to generate demographic stochasticity. By deafult ( stmat=NULL and fecundity1=TRUE) probabilities in the first row of the transition matrix (i.e mat[1,j]) are assumed to represent only fecundities, i.e., they would not account for "survival" transitions from stage[j] to stage[1], but only for newborns. This means that these probabilities will only be used as the mean for sampling from rpois. Transitions in rows others than first row will be assumed to represent "survival" transitions if its value is <=1 and accordingly will be employed to sample from rbinom. Transitions >1 will be assumed to represent fecundities and will be employed to sample from rpois.
在目前的实现中,有3个选项生成人口统计的随机性。默认值(stmat=NULL和fecundity1=TRUE)在第一行中的过渡矩阵的概率(即mat[1,j])被认为仅代表生殖力,即,他们就不能解释为“求生存”的转换从阶段[J]阶段[1],但仅适用于新生儿。这意味着,这些概率将仅用于作为采样rpois平均值。在第一行的行别人比的转换将被假定为代表的“生存”的转换,如果它的值是<= 1,因此将样品从rbinom。假设转换> 1代表生殖力,,将样本rpois。

If stmat=NULL and fecundity1=FALSE transition probabilities in all the rows of the matrix mat are treated in the same way, i.e. probabilities <=1 will be sampled from rbinom and probabilities >1 will be sampled from rpois.
如果stmat=NULL和fecundity1=FALSE的转移概率在所有的行矩阵mat以同样的方式处理,即概率将采样从rbinom和概率= 1> 1将被抽样从rpois。

If a stmat matrix (a matrix with values between 0 and 1) is provided, it will be used to divide transition probabilities mat[i,j] into fecundities (mat[i,j] * stmat[i,j]) and survival probabilities (mat[i,j] - (mat[i,j] * stmat[i,j])) and these matrices will be used to sample from rbinom and rpois respectively.
如果stmat矩阵(在0和1之间的值的矩阵)提供,将被用来划分跃迁概率mat[i,j]到繁殖力(mat[i,j] * stmat[i,j])和生存概率(<X >)和这些矩阵将被用于样品分别从rbinom rpois。

The current implementation of estdemo assumes that reproduction takes place before "survival sorting", so even for individuals that wouldn't survive (according to its sampled binomial probability) offspring is computed (if approppriate) and accounted for.
目前实施的estdemo假定复制前发生的“生存排序”,因此,即使个人将无法生存(根据采样二项式概率)后代计算(如果approppriate),并占。

If environmental stochasticity is required (i.e., a matsd matrix is provided), project1 will call to estambi function, that for each time will change mat[i,j] probabilities sampling from rnorm with mean= mat[i,j] and sd = matsd[i,j]. If equalsign=TRUE the random changes in all cells of mat will have the same sign and the same magnitude (relative to each individual matsd[i,j]). If equalsign=FALSE every transition probability will change independently.
如果环境的随机性(即,matsd矩阵),project1会打检测给estambi功能,每一次都会改变mat[i,j]概率抽样准化mean= mat[i,j]和sd = matsd[i,j]。如果equalsign=TRUE在所有单元中的随机变化mat将具有相同的符号和相同的大小(相对于每个单独的matsd[i,j])。如果equalsign=FALSE每一个转移概率独立改变的。

If both environmental and demographic stochasticity are required project1 will call first to estambi and using the modified mat will call to estdemo.
如果需要环境和人口的随机性project1将调用第一estambi和使用修改后的mat会打检测给estdemo。

If management is required, a vector or matrix of magement actions  should be provided. In the simplest case (i.e., a vector), each element in the vector will be interpreted as the management action that will be applied each time step to the corresponding stage. Positive and negative elements in the vector represent respectively the introduction or extraction of individuals from the corresponding stage. Elements whose absolute value is >= 1 will be interpreted as the introduction or extraction of exactly that number of individuals; absolute values < 1 will be interpreted as the introduction or extraction of that proportion of individuals from the existing individuals in the corresponding stage. If "management" is a matrix, each time step the management actions represented by each column of the matrix will be applied sequentially, from first to last.
如果需要管理,计划生育管理行动的向量或矩阵的应提供。在最简单的情况下(即,一个向量),向量中的每一个元素将被解释为将要应用于每个时间步长的相应阶段的管理行动。正面和负面的Vector中的元素分别代表介绍或个人从提取相应的阶段。元素,其绝对值> = 1将被解释为,个人数完全相同的引进或提取绝对值<1将被解释为在相应的阶段,从现有的个人的个人比例的引进或提取。如果“管理”是一个矩阵,每个时间步长矩阵的每一列代表将被应用的管理行动顺序,从第一个到最后。


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

project1, estdemo and estambi return a vector of stage abundances with the same length that v0. projectn return an object of class rmas, basically a list with four elements: vn, with length = (nrep) where each of its elements represents a replicate simulation and consist of a matrix of dimensions [lengtth(v0), time] representing the abundance of each stage at each time. If the simulation included management actions, harvest will be a list of length (nrep) where each of its elements represents the trajectory of harvest in a replicate simulation and consist of a matrix of dimensions [lengtth(v0), time] representing the number of individuals extracted of each stage at each time. The other two elements, mat and management,  are respectively the transition matrix and the managenet matrix employed in the simulations. The plot method will draw the demographic trajectory of the population. By default (sum = TRUE, mean=FALSE) it will plot the abundance of the whole population (i.e. the the sum of abundances in each stage) vs. time. If nrep >1 it will plot together the trajectory of each replicated population. If ( sum = TRUE, mean=TRUE) it will plot the mean of all repplicated populations. If (sum = FALSE, mean=TRUE) it wil plot the abundance (or the mean abundance in all the replications) of each stage vs. time.
project1,estdemo和estambi返回阶段丰度的矢量具有相同的长度,v0。 projectn返回一个对象的类rmas,基本上有四个元素的列表:vn,长度=(nrep),它的每个元素复制模拟,包括[lengtth(v0), time]代表每个阶段的丰度在每个时间的维度的矩阵。如果仿真包括管理行动,harvest将是一个列表的长度(nrep),它的每个元素表示在复制模拟和收获的轨迹组成的矩阵的维[lengtth(v0), time] 代表每个阶段的提取在每个时间的数量的个人。其他两个要素,mat和management,分别是过渡矩阵和managenet的矩阵模拟中。 “plot方法会得出人口的人口轨迹。默认情况下(sum = TRUE, mean=FALSE)将绘制丰富的总人口(即在每个阶段的丰度的总和)与时间。如果NREP> 1,将绘制在一起的轨迹,每一个复制的人口。如果(sum = TRUE, mean=TRUE)将绘制的平均的所有repplicated人口。如果(sum = FALSE, mean=TRUE)西港岛线图的每一个阶段对时间的丰度(或平均丰度在所有复制)。

The summary and plot.summary methods will print a table and draw a plot respectively with the maximun, mean + 1 sd, mean, mean - 1 sd and minimum values of population abundance in all the simulations.
summary和plot.summary方法将打印出表格,并分别画一个图的最大程度,意味着+ 1 SD,意思是说,意思是 -  1个SD值和最低值的种群数量在所有的模拟。


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



Marcelino de la Cruz <a href="mailto:marcelino.delacruz@upm.es">marcelino.delacruz@upm.es</a>




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


Akcakaya, H. R., Burgman, M. A. and Ginzburg L.R. 1999. Applied Population Ecology. Sinauer. Caswell, H. 2003. Matrix Population Models: Construction, Analysis, and Interpretation . SInauer.


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


   ## Not run: [#不运行:]
     data(coryphanthaA)
     coryphanthaA <- as.tmatrix(coryphanthaA)
  
     # run a deterministic simulation of 20 years from an initial state of[20年的运行一个确定性模拟从初始状态]
     # 100 small juveniles:[100人的小少年:]
     v0 <- c(100,0,0)
     simu20 <- projectn(v0=v0, mat=coryphanthaA, time = 20)
     plot(simu20, sum=FALSE)
     summary(simu20)
  
     # run 100 simulations of 20 years with  demographic stochasticity:[100模拟运行20年,人口的随机性:]
     simu20.ds <- projectn(v0=v0, mat=coryphanthaA, time = 20, estdem=TRUE, nrep=100)
     plot(simu20.ds)
     summary(simu20.ds)
     
     # run 100 simulations of 20 years with  demographic stochasticity but [100模拟运行20年,人口的随机性,但]
     # assuming that the first row of the transition matrix represent both[假设过渡矩阵的第一行中,同时代表]
     # fecundity and survival, each with a 50[繁殖力和生存,每个50]
     
     # first generate the stmat matrix:[首先生成的stmat矩阵:]
     stmat <- (coryphanthaA >0)
     stmat <- stmat*c(0.5,0,0)
     stmat
     
     simu20.ds2 <- projectn(v0=v0, mat=coryphanthaA, time = 20, estdem=TRUE,
                             stmat=stmat, nrep=100)
     plot(simu20.ds2)
     summary(simu20.ds2)
         
  
     # run 100 simulations of 20 years with  both demographic and environmental[100模拟运行20年,人口和环境]
     # stochasticity:[随机性:]
     # first generate a sd matrix to describe environmental stochasticity:[首先生成一个SD矩阵来描述环境的随机性:]
     sdenv <- coryphanthaA/20
     sdenv
     
     simu20.eds <- projectn(v0=v0, mat=coryphanthaA, matsd =sdenv,  time = 20,
                            estdem=TRUE,estamb=TRUE, nrep=100)
     plot(simu20.eds)
     summary(simu20.eds)
     
     # Example of management actions[管理操作的示例]
     #    each time step, 10 individuals will be added to the first stage ,10 individuals will be [每个时间步长,10的个人将被添加到第一阶段,10个人将]
     #    added to the second stage, and 50 percent of the individuals in the third stage will be extracted[添加到第二阶段,在第三阶段中的50%的个人将被提取]
     
        man <- c(10, 10, -0.5)
        p1 <- projectn(v0 = c(100, 100,100), mat= coryphanthaA, management=man)
       
        # summarize and plot population trajectory[总结和绘制人口的轨迹]
        summary(p1)
       
        # summarizes and plots harvest history[总结和图收获历史]
        summary(p1, harvest=T)  
           
  
## End(Not run)[#(不执行)]

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-26 18:53 , Processed in 0.029207 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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