Learn R Programming

laser (version 2.1)

fitdAICrc: Test for Rate Variation Using delta-AICrc Test Statistic

Description

Fits a specified set of rate-variable and rate-constant variants of the birth-death model to branching times from phylogenetic data. The test statistic dAICrc is the difference in AIC scores between the best rate-constant and rate-variable models.

Usage

fitdAICrc(x, modelset = c("pureBirth", "bd", "DDL", "DDX", "yule2rate", 
                "rvbd"), ints = NULL)

Arguments

Value

  • a dataframe with the number of rows equal to the number of candidate models. Columns include likelihoods, parameters, and AIC scores for each model. The first column contains the model names. If a parameter is not present in a particular model, it will have an entry of 'NA' in the column for that parameter. Parameter names follow conventions for model descriptions in other parts of this document. For example, parameter r1 is the initial net diversification rate for all models (note that this will be the only rate for the pureBirth model). The full set of columns if all available models are included in the candidate set will consist of the following:
  • modelthe model name for row i in the dataframe
  • paramsthe free parameters for model[i]
  • npthe number of free parameters in mode[i]
  • mtypeeither 'RC' for rate-constant or 'RV' for rate-variable
  • LHthe log-likelihood under model[i]
  • r1, r2, r3net diversification rates, as applicable; r1 is always the initial rate, and r3 is always the final rate
  • athe extinction fraction E/S if applicable
  • xpthe x-parameter from the DDX model
  • kthe k-parameter from the DDL model
  • st1, st2shift-times, if applicable. st1 is always the first shift point
  • AICthe Akaike Information Criterion for model[i]
  • dAICdelta-AIC; the difference in AIC scores between model[i] and the overall best-fit model

Details

fitdAICrc implements the dAICrc test statistic for temporal variation in diversification rates as described in Rabosky (2006). modelset is a list of the rate-constant and rate-variable models to consider. You should include both rate-constant models (pureBirth and bd), as well as one or more candidate rate-variable models. Available options are DDX, DDL, yule2rate, rvbd, and yule3rate. See full descriptions of each of these models this document. 'ints' is used in determining the number of shift points to consider. If 'ints = NULL' (the default), the model will consider only observed branching times as possible shift points. See yule-n-rate for additional discussion of the 'ints' option.

References

Nee, S., R. M. May, and P. H. Harvey. 1994b. The reconstructed evolutionary process. Philos. Trans. R. Soc. Lond. B 344:305-311.

Rabosky, D. L. 2006. Likelihood methods for inferring temporal shifts in diversification rates. Evolution 60:1152-1164.

Examples

Run this code
data(agamids)
agbtimes <- getBtimes(string = agamids)
#agbtimes is now a vector of branching times from the agamid phylogeny

#here we fit 2 rate-constant and 3 rate-variable models 
# to the agamid data:
result <- fitdAICrc(agbtimes, modelset = c("pureBirth", "bd",
          "DDX", "DDL", "yule2rate"), ints = 100)

# this outputs summaries of parameters and likelihoods to screen; 
# object 'result' is a dataframe containing all parameter estimates, 
# likelihoods, and AIC scores

Run the code above in your browser using DataLab