I realize this might not be the best place to have this question answered, but I figured I'd try anyway. My question concerns the calculation of log likelihoods for ancestral state estimates using the maximum likelihood Brownian motion model from ace
in the ape
package. My understanding is that scaling all the branches of the phylogeny by a constant should not change the log likelihood of the maximum likelihood ancestral states (why would it?). However, look what happens when I compare the log likelihoods of ML ancestral states for the same data and tree, except in the second model the branches of the tree have all been multiplied by 2:
# Load packages and set seed
library(ape)
library(geiger)
library(phytools)
set.seed(23)
# Generate trees
tree <- rcoal(20)
tree2 <- tree
tree2$edge.length <- tree2$edge.length*2
# Generate data
data <- fastBM(tree)
# Check log likelihoods of ML ancestral state estimates
ace(data, tree, method="ML")$loglik
ace(data, tree2, method="ML")$loglik
The log likelihoods are clearly different, it has approximately doubled in the model with branch lengths doubled (13.18 versus 26.35). If I compare the log likelihoods of Brownian motion models fit to the data and trees using the fitContinuous
function from the geiger
package, the log likelihoods are exactly the same (3.73) as I would expect.
# Check log likelihoods of BM model fit
logLik(fitContinuous(tree, data))
logLik(fitContinuous(tree2, data))
So what is going on with the log likelihoods from ML ancestral states estimated in ace
? Why do they change when the tree is simply scaled up or down without changing the relationships among taxa?