Skip to content

Instantly share code, notes, and snippets.

@cboettig
Created September 7, 2010 21:47
Show Gist options
  • Save cboettig/569188 to your computer and use it in GitHub Desktop.
Save cboettig/569188 to your computer and use it in GitHub Desktop.
require(ouch)
####### Anoles example ########
data(bimac) # ouch package Anolis sizes (from N. Lesser Antilles)
tree <- with(bimac,ouchtree(node,ancestor,time/max(time),species))
bm <- brown(log(bimac['size']),tree)
ou1 <- hansen(log(bimac['size']),tree,bimac['OU.1'],1,1)
ou3 <- hansen(log(bimac['size']),tree,bimac['OU.3'],1,1)
ou4 <- hansen(log(bimac['size']),tree,bimac['OU.4'],1,1)
ouLP <- hansen(log(bimac['size']),tree,bimac['OU.LP'],1,1, reltol=1e-5)
ou2_regimes <- as.factor(c(2,1,1,1,1,1,2,2,2,2,2,2,1,1,1,1,2,2,2,1,2,2,1,1,1,1,1,1,2,2,2,2,2,2,1,1,1,1,2,2,1,1,2,2,2))
names(ou2_regimes) <- bm@nodes
ou2 <- hansen(log(bimac['size']),tree,ou2_regimes,1,1)
anoles_models <- list(bm = bm, ou1 = ou1, ou3 = ou3, ou4 = ou4, ouLP = ouLP, ou2=ou2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment