dd_LR | R Documentation |
This function computes the maximum likelihood and the associated estimates of the parameters of a diversity-dependent diversification model for a given set of phylogenetic branching times. It then performs a bootstrap likelihood ratio test of the diversity-dependent (DD) model against the constant-rates (CR) birth-death model. Finally, it computes the power of this test.
dd_LR(
brts,
initparsoptDD,
initparsoptCR,
missnumspec,
outputfilename = NULL,
seed = 42,
endmc = 1000,
alpha = 0.05,
plotit = TRUE,
res = 10 * (1 + length(brts) + missnumspec),
ddmodel = 1,
cond = 1,
btorph = 1,
soc = 2,
tol = c(0.001, 1e-04, 1e-06),
maxiter = 2000,
changeloglikifnoconv = FALSE,
optimmethod = "subplex",
methode = "analytical"
)
brts |
A set of branching times of a phylogeny, all positive |
initparsoptDD |
The initial values of the parameters that must be optimized for the diversity-dependent (DD) model: lambda_0, mu and K |
initparsoptCR |
The initial values of the parameters that must be optimized for the constant-rates (CR) model: lambda and mu |
missnumspec |
The number of species that are in the clade but missing in the phylogeny |
outputfilename |
The name (and location) of the file where the output will be saved. Default is no save. |
seed |
The seed for the pseudo random number generator for simulating the bootstrap data |
endmc |
The number of bootstraps |
alpha |
The significance level of the test |
plotit |
Boolean to plot results or not |
res |
Sets the maximum number of species for which a probability must be computed, must be larger than 1 + length(brts) |
ddmodel |
Sets the model of diversity-dependence: |
cond |
Conditioning: |
btorph |
Sets whether the likelihood is for the branching times (0) or the phylogeny (1) |
soc |
Sets whether stem or crown age should be used (1 or 2) |
tol |
Sets the tolerances in the optimization. Consists of: |
maxiter |
Sets the maximum number of iterations in the optimization |
changeloglikifnoconv |
if TRUE the loglik will be set to -Inf if ML does not converge |
optimmethod |
Method used in optimization of the likelihood. Current default is 'subplex'. Alternative is 'simplex' (default of previous versions) |
methode |
The method used to solve the master equation, default is 'analytical' which uses matrix exponentiation; alternatively numerical ODE solvers can be used, such as 'odeint::runge_kutta_cash_karp54'. These were used in the package before version 3.1. |
The output is a list with 3 elements:
treeCR |
a list of trees generated under the constant-rates model using the ML parameters under the CR model |
treeDD |
a list of trees generated under the diversity-dependent model using the ML parameters under the diversity-dependent model |
out |
a dataframe with the
parameter estimates and maximum likelihoods for diversity-dependent and
constant-rates models |
pvalue |
p-value of the test |
LRalpha |
Likelihood ratio at the signifiance level alpha |
poweroftest |
power of the test for significance level alpha |
Rampal S. Etienne & Bart Haegeman
- Etienne, R.S. et al. 2016. Meth. Ecol. Evol. 7: 1092-1099,
doi: 10.1111/2041-210X.12565
- Etienne, R.S. et al. 2012, Proc. Roy.
Soc. B 279: 1300-1309, doi: 10.1098/rspb.2011.1439
- Etienne, R.S. & B.
Haegeman 2012. Am. Nat. 180: E75-E89, doi: 10.1086/667574
dd_loglik
, dd_ML
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.