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

R语言 TreePar包 bd.shifts.optim()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-10-1 11:51:10 | 显示全部楼层 |阅读模式
bd.shifts.optim(TreePar)
bd.shifts.optim()所属R语言包:TreePar

                                         bd.shifts.optim: Estimating speciation and extinction rate changes and mass extinction events in phylogenies
                                         bd.shifts.optim:,估计物种和物种灭绝速度的变化和在系统发育的生物大灭绝事件

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

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

bd.shifts.optim estimates the maximum likelihood speciation and extinction rates together with the rate shift times t=(t_1,t_2 .., t_m) in a (possibly incomplete sampled) phylogeny. At the times t, the rates are allowed to change and the species may undergo a mass extinction event.
bd.shifts.optim连同估计最大似然形态和消光率的速率移时间t =(T_1,T_2 ..,t_m),在一个(可能是不完整的采样)系统发育。在时间t的价格可以改变和物种可能进行大规模灭绝事件。


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


bd.shifts.optim(x, sampling, grid, start, end, maxitk = 5, yule = FALSE, ME = FALSE, all = FALSE, posdiv = FALSE, miniall = c(0), survival = 1,groups=0)



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

参数:x
Vector of speciation times in the phylogeny. Time is measured increasing going into the past with the present being time 0. x can be obtained from a phylogenetic tree using getx(TREE).  
向量的形态时代的亲缘关系。时间测量增加进入的过去与目前时间0。 x可以从系统树的getX(TREE)。


参数:sampling
Vector of length m. sampling_i is the probability of a species surviving the mass extinction at time t_i. sampling_1 is the probability of an extant species being sampled. sampling_1=1 means that the considered phylogeny is complete. sampling_i=1 (i>1) means that at time t_i, a rate shift may occur but no species go extinct. If ME=TRUE, all entries but sampling_1 will be discarded as they are estimated (however, input a vector sampling of the appropriate length such that the program knows how many mass extinction events you want to allow for).  
向量的长度为m。 sampling_i时间t_i幸存的物种大灭绝一个物种的概率。 sampling_1是一个现存的物种被抽样的概率。 sampling_1 = 1表示所考虑的系统发育完成。 sampling_i = 1(I> 1)表示在时间t_i,一个变动可能发生,但没有物种灭绝。如果ME = TRUE,所有的作品,但sampling_1将被丢弃,因为他们估计(但是,输入适当的长度,这样的程序知道多少大规模灭绝事件,你要允许一个矢量采样)。


参数:grid, start, end
The model parameters are optimized for different fixed rate shift times. The fixed rate shift times are specified by being at (start, start+grid, start+2*grid .. end). I calculate the likelihood for the different rate shift times t instead of optimizing t with the function optim used for the other parameters, as the optimization performed poor for t (namely getting stuck in local optima).
的模型参数进行了优化不同的固定速率换档时间。固定利率转变的时间规定的是(启动,启动+网格,开始+2 *格..结束)。我计算不同的速率转变时间t的可能性,而不是用于其他参数的功能OPTIM优化吨,执行的优化差为T(即陷入局部最优)。


参数:yule
yule=TRUE sets the extinction rates to zero.  
尤尔= TRUE设置灭绝利率降至零。


参数:maxitk
Integer value defining how many iterations shall be done in the optimization. Default is 5, but needs to be increased if too many warnings "convergence problem" appear.  
整型值确定,应做多少次迭代的优化。默认值是5,但需要增加,如果出现太多警告“衔接的问题”。


参数:ME
ME=FALSE (default) uses the mass extinction fractions specified in sampling and does not estimate them. If ME=FALSE is used with sampling=c(1,1, .. , 1), no mass extinction events are considered.  
ME = FALSE(默认)使用指定的采样的生物大灭绝分数并没有估计。如果ME = FALSE使用采样= C(1,1,...,1),被认为是没有大规模的生物灭绝事件。


参数:all
Only relevant when ME=TRUE. all=FALSE (default and recommended) estimates one speciation and one extinction rate for the whole tree, and estimates the intensities sampling_i (i>1) of mass extinction events. all=TRUE allows for varying speciation and extinction rates. Since the parameters might correlate, all=TRUE is not recommended.  
只有有关时ME = TRUE。所有= FALSE(默认和推荐)估计,整个树形态和一种鸟类灭绝率,估计强度sampling_i(1)大灭绝事件。所有允许不同的形态和物种灭绝率= TRUE。由于相关的参数,所有= TRUE不推荐使用。


参数:posdiv
posdiv=FALSE (default) allows the speciation - extinction rate to be negative, i.e. allows for periods of declining diversity. posdiv=TRUE forces the speciation - extinction rate to be positive.  
posdiv = FALSE(缺省)允许的形态 - 灭绝率是负的,即允许期间下降的多样性。 posdiv = TRUE强制的物种 - 物种灭绝速度是积极的。


参数:miniall
If you run the bd.shifts.optim for k shifts, but you now want to have K>k shifts, then set for continuing the analysis: update sampling, and set miniall=res[[2]] where res[[2]] is the output from the run with k shifts.  
如果你运行bd.shifts.optim的对k的变化,但你现在想K> K表的变化,然后继续分析:更新采样,并设置miniall = [2]其中res [2] ]是具有k位移从运行的输出。


参数:survival
If survival = 1: The likelihood is conditioned on survival of the process (recommended). Otherwise survival = 0.
如果生存= 1:可能的条件是生存的过程(推荐)。否则生存= 0。


参数:groups
If groups != 0: the first column of groups indicates the age of higher taxa and the second column the number of species in the higher taxa (each row in groups corresponds to a leaf in the tree).
如果群体!= 0时,第一列的组,表示较高的分类群和第二列的物种数在较高的分类单元(组中的每一行对应于树中的一个叶)的年龄。


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


参数:res[[1]][[i]]
List of maximum likelihood parameter estimates for each fixed t where i-1 shifts are allowed to occur (i in 1:m).
最大似然参数估计列表,其中的i-1位移允许发生(i在1:米)的每个固定的t。


参数:res[[2]][[i]]
Maximum likelihood parameter estimates for i-1 shifts (i in 1:m): First entry is the (-log likelihood) value. The next i entries are the turnover (extinction/speciation) estimates, for the successive intervals going back in time. The next i entries are the diversification rate estimates (speciation-extinction). The next i-1 entries are the sampling estimates (if ME=TRUE). The last i-1 entries are the shift times. (Note: if ME=TRUE and all==FALSE, the second entry is the turnover, the third the diversification rate, followed by the sampling estimates).
最大似然参数估计的i-1的变化(1米):第一项是(对数似然)值。接下来,我项目的营业额(消光/形态)的估计,连续间隔的时间。接下来,我的项目是多元化率估计值(物种灭绝)。 I-1项目的抽样估计(ME = TRUE)。最后的I-1项目是换档时间。 (注:如果ME = == TRUE和FALSE,第二个项目的营业额,第三个多元化率,采样估计)。


参数:res[[3]]
Vector of time points where the function was evaluated.
其中的功能进行评价的时间点的向量。


参数:res[[4]]
Array specifying the time points when there was a convergence problem: a row of res[[4]] with entry (i,t_i) means that when adding the i-th shift at time t_i, a convergence problem was encountered.
阵列指定的时间点,当有一个收敛的问题:一排的res [[4]]与的条目(ⅰt_i)指,当加入的第i个移位时t_i,收敛时遇到问题。


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

The likelihood is calculated assuming there were two lineages at the time of the root. The likelihood is conditioned on survival of the two lineages if survival = 1. Likelihood-values from bd.densdep.optim are directly comparable (eg AIC) for survival = 0. Likelihood-values from laser are comparable for survival = 0 after the transformation -res+(sum(log(2:length(x)))-(length(x)-1)*log(2)).
的可能性来计算假设有两个谱系,在根的时间。的可能性的条件是生存的生存两个谱系,如果= 1。似然值来自bd.densdep.optim的直接可比性(如AIC)= 0的生存。似然值从激光相媲美的生存= 0,改造后的水库+(SUM(log(2:长度(x))) - (长度(x)-1)* LOG(2))。


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



Tanja Stadler




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

T. Stadler & F. Bokma: Estimating speciation and extinction rates for phylogenies of higher taxa. Submitted, 2012. (for groups>0 but no rate shift) A. Lambert & T. Stadler: Coalescent point processes and phylogenies. Manuscript. (for groups>0)

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


set.seed(1)

# First we simulate a tree, and then estimate the parameters for the tree:[首先,我们模拟了树,然后估计的参数树:]
# Number of species[种数]
nspecies <- 20
# At time 1 and 2 in the past, we have a rate shift:[在过去,在时刻1和2中,我们有一个变动:]
time <- c(0,1,2)
# Mass extinction intensities 0.5 at time 1 in past, 0.4 at time 2 in past. Present day species are all sampled (rho_1=1):[大灭绝的强度在过去的时间过去,0.4时间1 0.5。现今的物种所有样本(rho_1,= 1):]
rho <- c(1,0.5,0.4)
# speciation rates (between t_i,t_{i+1} we have speciation rate lambda_i):[形态率(在t_i,T_ {i +1}我们有形态率lambda_i),]
lambda <- c(2,2,1)
# extinction rates (between t_i,t_{i+1} we have extinction rate mu_i):[灭绝率(在t_i,T_ {i +1},我们有灭绝的速度mu_i):]
mu <- c(1,1,0)
# Simulation of a tree:[模拟一棵树:]
tree<-sim.rateshift.taxa(nspecies,1,lambda,mu,frac=rho,times=time,complete=FALSE)
# Extracting the speciation times x:[提取的形态时间:]
x<-sort(getx(tree[[1]][[1]]),decreasing=TRUE)

# When estimating the shift times t for x, we allow the shift times to be 0.6, 0.8, 1, 1.2, .. ,2.4:[当推定变速时间t为x时,我们允许换档时间是0.6,0.8,1 1.2,.. 2.4:]
start <- 0.6
end <- 2.4
grid <- 0.2

# We fix rho and estimate time, lambda, mu:[我们修复,LAMBDA,亩rho和估计时间:]
res <- bd.shifts.optim(x,rho,grid,start,end)
res[[2]]
# We fix rho=1 and mu=0 and then estimate time, lambda:[我们解决ρ= 1亩= 0,然后估计时间,λ:]
resyule <- bd.shifts.optim(x,rho,grid,start,end,yule=TRUE)
resyule[[2]]
# We estimate time, rho, lambda, mu:[我们估计,ρ,λ,亩:]
resrho <- bd.shifts.optim(x,rho,grid,start,end,ME=TRUE)
resrho[[2]]

# Data analysis in Stadler &amp; Bokma, 2012:[数据分析施泰德和Bokma,2012年:]
# Number of species in each order from Sibley and Monroe (1990)[在每个订单的种数从西布利和梦露(1990)]
data(bird.orders)
S <- c(10, 47, 69, 214, 161, 17, 355, 51, 56, 10, 39, 152,6, 143, 358, 103, 319, 23, 291, 313, 196, 1027, 5712)

groups<-get.groups(bird.orders,S,0)
groupscut<-get.groups(bird.orders,S,96.43*0.207407)
x<-branching.times(bird.orders)
bd.shifts.optim(x,sampling=c(1),survival=1,groups=groups)[[2]]
bd.shifts.optim(x,sampling=c(1),survival=1,groups=groupscut)[[2]]

# allowing one shift in rates:[允许转移率:]
bd.shifts.optim(x,sampling=c(1,1),grid=1,start=20,end=25,survival=1,groups=groupscut)[[2]]

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-29 22:30 , Processed in 0.027024 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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