I want to calculate the AIC for a phylogeny that I inferred via maximum likelihood. To calculate the AIC I need to know the number of parameters in the model. But how do I determine this?

  • $\begingroup$ Biostar forum... bio informatics forum is a popular place which specializes in phylogeny statistics data researchers questions and answers biostars.org $\endgroup$ – aliential Nov 15 '18 at 7:19

The number of parameters depends both on the number of taxa and model of sequence evolution. The topology is not typically considered a parameter in the usual sense of statistical inference (as it is the a priori specified topology the likelihood was calculated on).

So, for example, if you infer a tree from nucleotide data for 25 sequences under the General Time Reversible (GTR) model with gamma distributed among-site rate heterogeneity and empirical stationary frequencies (this is commonly called GTR+F+G), then you would have 56 parameters with the following breakdown: 2n - 3 = 47 branch lengths (where n = 25, the number of tips), 3 frequencies (because these sum to 1, once three are known the other is automatically known, so we only count 3 estimated parameters), 5 substitution rates (there are actually 6 substitution parameters in GTR, but it is typical to set one, usually G > C, to 1, and estimate the others relative to this, hence only 5 estimated) and 1 alpha parameter for the shape of the gamma distribution of rates (gamma distributions actually have two parameters, alpha and beta, but for phylogenetics we usually constrain them to be equal).

In total, this gives 47 branch lengths and 3 + 5 + 1 = 9 model parameters, and 47 + 9 = 56

| improve this answer | |
  • $\begingroup$ Thank you, @NatWH! This is extremely helpful. In any of the phylogenetic classes of objects in R (e.g., phylo) is there a way to extract the number of parameters? $\endgroup$ – Namenlos Nov 15 '18 at 17:10
  • $\begingroup$ I don't know - R objects of class phylo don't store model specifications, so I doubt it. But there may be a function somewhere. If not, it should be simple enough to write your own. $\endgroup$ – NatWH Nov 15 '18 at 19:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.