Description Usage Arguments Value Author(s) References Examples
View source: R/get_tree_beta.R
Computes the maximum likelihood estimate of the parameter beta in trees simulated by the model, as a function of the proportion of conserved species
1 | get_tree_beta(epsilon, beta, alpha, N, sampl.frac, ntree, equal.ab = TRUE, eta = 1)
|
epsilon |
Minimum size of unsampled splits (see appendix 1) |
beta |
Imbalance index |
alpha |
Clade age-richness index |
N |
Initial tip number |
sampl.frac |
Vector of tips fractions for which we want to compute the beta statistic |
ntree |
Number of simulated trees |
equal.ab |
If set to TRUE, all species have the same probability to go extinct first (default to TRUE) |
eta |
Clade abundance-richness index (if equal.ab == FALSE) |
A table of size length(sample.fract)*ntree. The element in ligne i and column j is the Maximum Likelihood Estimate for the beta statistic of the j^th tree in wich a fraction sample.frac[i] has been sampled.
Odile Maliet, Fanny Gascuel & Amaury Lambert
Maliet O., Gascuel F., Lambert A. (2018) Ranked tree shapes, non-random extinctions and the loss of phylogenetic diversity, bioRxiv 224295, doi: https://doi.org/10.1101/224295
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | # With the field of bullets hypothesis
set.seed(813)
sampl.frac=seq(0.2,1,0.2)
Beta=get_tree_beta(epsilon=0.01, beta=-1, alpha=-1, N=20, sampl.frac=sampl.frac, ntree=3)
Beta_quantiles=sapply(1:nrow(Beta),function(x){quantile(Beta[x,],c(0.05,0.5,0.95))})
plot(1, type="n", xlab="Fraction of extinct species, p", ylab="Beta statistic",
ylim=c(-2,10), xlim=c(0,1))
polygon(c(1-sampl.frac, rev(1-sampl.frac)), c(Beta_quantiles[1,(1:length(sampl.frac))],
rev(Beta_quantiles[3,(1:length(sampl.frac))])), border=NA, col=grey(0.7))
points(1-sampl.frac, Beta_quantiles[2,(1:length(sampl.frac))],t="l")
# With nonrandom extinctions
## Not run:
set.seed(813)
sampl.frac=seq(0.2,1,0.2)
Beta=get_tree_beta(epsilon=0.01, beta=5, alpha=2, eta=2, N=20,
sampl.frac=sampl.frac, ntree=3)
Beta_quantiles=sapply(1:nrow(Beta),function(x){quantile(Beta[x,],c(0.05,0.5,0.95))})
plot(1, type="n", xlab="Fraction of extinct species, p",
ylab="Beta statistic", ylim=c(-2,10), xlim=c(0,1))
polygon(c(1-sampl.frac, rev(1-sampl.frac)),
c(Beta_quantiles[1,(1:length(sampl.frac))],
rev(Beta_quantiles[3,(1:length(sampl.frac))])), border=NA, col=grey(0.7))
points(1-sampl.frac, Beta_quantiles[2,(1:length(sampl.frac))],t="l")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.