diff --git a/dist/BBD.addon.zip b/dist/BBD.addon.zip index fed1693..e27abbd 100644 Binary files a/dist/BBD.addon.zip and b/dist/BBD.addon.zip differ diff --git a/src/bbd/distributions/LatencyPrior.java b/src/bbd/distributions/LatencyPrior.java index 18a4a00..f07d708 100644 --- a/src/bbd/distributions/LatencyPrior.java +++ b/src/bbd/distributions/LatencyPrior.java @@ -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