revbayes / revbayes.archive

GNU General Public License v3.0
68 stars 37 forks source link

Fix covarion scale #186

Closed bredelings closed 4 years ago

bredelings commented 4 years ago

Both covarion methods get the wrong likelihood because they do not scale branches to the expected number of substitutions. Instead, they scale branches to the expected number of state changes.

This PR fixes both covarion methods to get the correct likelihood on a test case by computing the averageRate() correctly. It is now possible to match HKY likelihoods when all clock_rates == 1 without setting rescale=FALSE.

This patch does not address issues where the matrix exponential diverges for weird parameter values. That will be next.