Skip to content

Commit

Permalink
patch for first sampling event not at current time
Browse files Browse the repository at this point in the history
  • Loading branch information
yucais committed Apr 12, 2024
1 parent 4e405f2 commit 1d52329
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/dr/evomodel/speciation/CachedGradientDelegate.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ private double[] getGradientLogDensityImpl() {

int currentModelSegment = 0;

while (treeIntervals.getStartTime() >= modelBreakPoints[currentModelSegment]) { // TODO Maybe it's >= ?
++currentModelSegment;
speciationModel.updateLikelihoodModelValues(currentModelSegment);
}

provider.processGradientSampling(gradient, currentModelSegment, treeIntervals.getStartTime()); // TODO Fix for getStartTime() != 0.0

for (int i = 0; i < treeIntervals.getIntervalCount(); ++i) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,12 @@ final BigFastTreeIntervals getTreeIntervals() {

int currentModelSegment = 0;

double logL = speciationModel.processSampling(0, treeIntervals.getStartTime()); // TODO Fix for getStartTime() != 0.0
while (treeIntervals.getStartTime() >= modelBreakPoints[currentModelSegment]) { // TODO Maybe it's >= ?
++currentModelSegment;
speciationModel.updateLikelihoodModelValues(currentModelSegment);
}

double logL = speciationModel.processSampling(currentModelSegment, treeIntervals.getStartTime()); // TODO Fix for getStartTime() != 0.0

for (int i = 0; i < treeIntervals.getIntervalCount(); ++i) {

Expand Down

0 comments on commit 1d52329

Please sign in to comment.