fit_coal_var: Fit birth-death model using a coalescent approch

fit_coal_varR Documentation

Fit birth-death model using a coalescent approch

Description

Fits the expanding diversity model with potentially time-varying rates and potentially missing extant species to a phylogeny, by maximum likelihood. The implementation allows only exponential time variation of the speciation and extinction rates, although this could be modified using expressions in Morlon et al. PloSB 2010. Notations follow Morlon et al. PLoSB 2010.

Usage

fit_coal_var(phylo, lamb0 = 0.1, alpha = 1, mu0 = 0.01, beta = 0,
             meth = "Nelder-Mead", N0 = 0, cst.lamb = FALSE, cst.mu = FALSE,
             fix.eps = FALSE, mu.0 = FALSE, pos = TRUE)

Arguments

phylo

an object of type 'phylo' (see ape documentation)

lamb0

initial value of the speciation rate at present (used by the optimization algorithm)

alpha

initial value of the parameter controlling the exponential variation in speciation rate (used by the optimization algorithm)

mu0

initial value of the extinction rate at present (used by the optimization algorithm)

beta

initial value of the parameter controlling the exponential variation in extinction rate.

meth

optimization to use to maximize the likelihood function, see optim for more details.

N0

Number of extant species. With default value(0), N0 is set to the number of tips in the phylogeny. That is, the phylogeny is assumed to be 100% complete.

cst.lamb

logical: should be set to TRUE only if f.lamb is constant (i.e. does not depend on time, models 3, 4b & 5 in Morlon et al. PloSB 2010) to use analytical instead of numerical computation in order to reduce computation time.

cst.mu

logical: should be set to TRUE only if f.mu is constant (i.e. does not depend on time, models 3 & 4a in Morlon et al. PloSB 2010) to use analytical instead of numerical computation in order to reduce computation time.

fix.eps

logical: should be set to TRUE only if the extinction fraction is constant (i.e. does not depend on time, model 4c in Morlon et al. PloSB 2010)

mu.0

logical: should be set to TRUE to force the extinction rate to 0 (models 5 & 6 in Morlon et al. PloSB 2010)

pos

logical: should be set to FALSE only to not enforce positive speciation and extinction rates

Details

The function fits models 3 to 6 from the PloSB 2010 paper. Likelihoods arising from these models are computed using the coalescent approximation and are directly comparable to likelihoods from the fit_coal_cst function, thus allowing to test support for equilibrium versus expanding diversity scenarios.

These models can be fitted using the options specified below:

  • model 3: with cst.lamb=TRUE & cst.mu=TRUE

  • model 4a: with cst.lamb=FALSE & cst.mu=TRUE

  • model 4b: with cst.lamb=TRUE & cst.mu=FALSE

  • model 4c: with cst.lamb=FALSE, cst.mu=FALSE & fix.eps=TRUE

  • model 4d: with cst.lamb=FALSE, cst.mu=FALSE & fix.eps=FALSE

  • model 5: with cst.lamb=TRUE & mu.0=TRUE

  • model 6: with cst.lamb=FALSE & mu.0=TRUE

Time runs from the present to the past. Hence, if alpha is estimated to be positive (for example), this means that the speciation rate decreases from past to present.

Value

a list with the following components

model

the name of the fitted model

LH

the maximum log-likelihood value

aicc

the second order Akaike's Information Criterion

model.parameters

the estimated parameters

Author(s)

H Morlon

References

Morlon, H., Potts, M.D., Plotkin, J.B. (2010) Inferring the dynamics of diversification: a coalescent approach, PLoS B 8(9): e1000493

Morlon, H., Kemps, B., Plotkin, J.B., Brisson, D. (2012) Explosive radiation of a bacterial species group, Evolution, 66: 2577-2586

Morlon, H. (2014) Phylogenetic approaches for studying diversification, Eco Lett, 17:508-525

See Also

likelihood_coal_var, fit_coal_cst

Examples

data(Cetacea)

if(test){
result <- fit_coal_var(Cetacea, lamb0=0.01, alpha=-0.001, mu0=0.0, beta=0, N0=89)
print(result)
}

RPANDA documentation built on Oct. 24, 2022, 5:06 p.m.