Description Usage Arguments Details Value Author(s) References Examples
Calculates AICc for a Hansen model using combined likelihoods across multiple traits
1 2 |
fit |
Fitted Hansen model object (the list returned by one iteration of |
L |
Log-likelihood of the model |
np |
Number of parameters in the model |
n |
Sample size (total number of trait values) |
AICc |
A logical indicating whether to use small-sample size corrected AIC; defaults to |
The number of parameters is calculated as p = k + (k' + 2) m, where k is the number of regime shifts, k' is the number of distinct regimes, and m is the number of traits. Note that this differs from many applications of Hansen models, in that SURFACE counts regime shifts as "parameters", modeling the complexity of both the adaptive landscape (number of regimes) and the evolutionary history of the clade (number of regime shifts). For AICc, the sample size is taken to be the total number of trait values mn, where n is the number of taxa
npSurface
returns an integer number of parameters. getAIC
returns a numeric AIC or AICc value
Travis Ingram
Ingram, T. & Mahler, D.L. (2013) SURFACE: detecting convergent evolution from comparative data by fitting Ornstein-Uhlenbeck models with stepwise AIC. Methods in Ecology and Evolution 4: 416-425.
1 2 3 4 5 6 7 8 9 | data(surfaceDemo)
tree<-surfaceDemo$tree
dat<-surfaceDemo$sim$dat
olist<-convertTreeData(tree,dat)
otree<-olist[[1]]; odata<-olist[[2]]
startmod<-startingModel(otree, odata, shifts = c("6"="b"))
np<-as.numeric(npSurface(startmod[[1]]))
LnL<-sum(sapply(startmod[[1]]$fit, function(x) summary(x)$loglik))
getAIC(LnL,np,n=ncol(dat)*nrow(dat),AICc=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.