Skip to content

Commit

Permalink
small bug in LatencyPrior
Browse files Browse the repository at this point in the history
  • Loading branch information
brj1 committed Feb 16, 2023
1 parent 5f4012f commit e8f41ad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Binary file modified dist/BBD.addon.zip
Binary file not shown.
8 changes: 4 additions & 4 deletions src/bbd/distributions/LatencyPrior.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,16 @@ public double calculateLogP() {
int k = 0;

final double tMRCA = tree.getRoot().getDate();
final double rate = reactivationRate - latencyRate;
final double rate = reactivationRate - latencyRate;

for (final int i : taxonIndex) {
double date = tree.getNode(i).getDate();

if (date > tMRCA && date < oriDate[i]) {
if (date > tMRCA && date < oriDate[k]) {
// likelihood of going latent at `date` given sampling date
logP += Math.exp(rate * date) *
rate /
(Math.exp(rate * oriDate[i]) -
(Math.exp(rate * oriDate[k]) -
Math.exp(rate * tMRCA));
} else {
// not in range
Expand Down

0 comments on commit e8f41ad

Please sign in to comment.