| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
package dr.evomodel.coalescent; |
| 27 |
|
| 28 |
import dr.evolution.coalescent.Coalescent; |
| 29 |
import dr.evolution.coalescent.DemographicFunction; |
| 30 |
import dr.evolution.coalescent.ScaledDemographic; |
| 31 |
import dr.evolution.tree.NodeRef; |
| 32 |
import dr.evolution.tree.Tree; |
| 33 |
import dr.evolution.util.Units; |
| 34 |
import dr.evomodel.tree.TreeModel; |
| 35 |
import dr.evomodelxml.coalescent.CoalescentLikelihoodParser; |
| 36 |
import dr.inference.model.*; |
| 37 |
import dr.math.Binomial; |
| 38 |
import dr.util.ComparableDouble; |
| 39 |
import dr.util.HeapSort; |
| 40 |
|
| 41 |
import java.util.ArrayList; |
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
public class OldAbstractCoalescentLikelihood extends AbstractModelLikelihood implements Units { |
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
protected MultiLociTreeSet treesSet = null; |
| 69 |
|
| 70 |
public enum CoalescentEventType { |
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
COALESCENT, |
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
NEW_SAMPLE, |
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
NOTHING |
| 86 |
} |
| 87 |
|
| 88 |
public OldAbstractCoalescentLikelihood(Tree tree, DemographicModel demoModel) { |
| 89 |
this(CoalescentLikelihoodParser.COALESCENT_LIKELIHOOD, tree, demoModel, true); |
| 90 |
} |
| 91 |
|
| 92 |
public OldAbstractCoalescentLikelihood(MultiLociTreeSet treesSet, DemographicModel demoModel) { |
| 93 |
super(CoalescentLikelihoodParser.COALESCENT_LIKELIHOOD); |
| 94 |
this.demoModel = demoModel; |
| 95 |
this.tree = null; |
| 96 |
this.treesSet = treesSet; |
| 97 |
|
| 98 |
if (demoModel != null) { |
| 99 |
addModel(demoModel); |
| 100 |
} |
| 101 |
|
| 102 |
for (int nt = 0; nt < treesSet.nLoci(); ++nt) { |
| 103 |
final Tree t = treesSet.getTree(nt); |
| 104 |
if (t instanceof Model) { |
| 105 |
addModel((Model) t); |
| 106 |
} |
| 107 |
} |
| 108 |
} |
| 109 |
|
| 110 |
public OldAbstractCoalescentLikelihood(String name, Tree tree, DemographicModel demoModel, boolean setupIntervals) { |
| 111 |
super(name); |
| 112 |
|
| 113 |
this.demoModel = demoModel; |
| 114 |
this.tree = tree; |
| 115 |
|
| 116 |
if (tree instanceof TreeModel) { |
| 117 |
addModel((TreeModel) tree); |
| 118 |
} |
| 119 |
|
| 120 |
if (demoModel != null) { |
| 121 |
addModel(demoModel); |
| 122 |
} |
| 123 |
|
| 124 |
if (setupIntervals) setupIntervals(); |
| 125 |
|
| 126 |
addStatistic(new DeltaStatistic()); |
| 127 |
} |
| 128 |
|
| 129 |
OldAbstractCoalescentLikelihood(String name) { |
| 130 |
super(name); |
| 131 |
} |
| 132 |
|
| 133 |
|
| 134 |
|
| 135 |
|
| 136 |
|
| 137 |
|
| 138 |
|
| 139 |
|
| 140 |
|
| 141 |
public NodeRef getMRCAOfCoalescent(Tree tree) { |
| 142 |
return tree.getRoot(); |
| 143 |
} |
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
public NodeRef[] getExcludedMRCAs(Tree tree) { |
| 151 |
return null; |
| 152 |
} |
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
protected void handleModelChangedEvent(Model model, Object object, int index) { |
| 159 |
if (model == tree) { |
| 160 |
|
| 161 |
intervalsKnown = false; |
| 162 |
} else { |
| 163 |
|
| 164 |
} |
| 165 |
|
| 166 |
likelihoodKnown = false; |
| 167 |
} |
| 168 |
|
| 169 |
|
| 170 |
|
| 171 |
|
| 172 |
|
| 173 |
|
| 174 |
|
| 175 |
protected void handleVariableChangedEvent(Variable variable, int index, Parameter.ChangeType type) { |
| 176 |
} |
| 177 |
|
| 178 |
|
| 179 |
|
| 180 |
|
| 181 |
|
| 182 |
|
| 183 |
|
| 184 |
|
| 185 |
protected void storeState() { |
| 186 |
if (tree != null) { |
| 187 |
System.arraycopy(intervals, 0, storedIntervals, 0, intervals.length); |
| 188 |
System.arraycopy(lineageCounts, 0, storedLineageCounts, 0, lineageCounts.length); |
| 189 |
storedIntervalsKnown = intervalsKnown; |
| 190 |
storedIntervalCount = intervalCount; |
| 191 |
storedLikelihoodKnown = likelihoodKnown; |
| 192 |
} else if (treesSet != null) { |
| 193 |
treesSet.storeTheState(); |
| 194 |
} |
| 195 |
storedLogLikelihood = logLikelihood; |
| 196 |
} |
| 197 |
|
| 198 |
|
| 199 |
|
| 200 |
|
| 201 |
protected void restoreState() { |
| 202 |
if (tree != null) { |
| 203 |
System.arraycopy(storedIntervals, 0, intervals, 0, storedIntervals.length); |
| 204 |
System.arraycopy(storedLineageCounts, 0, lineageCounts, 0, storedLineageCounts.length); |
| 205 |
intervalsKnown = storedIntervalsKnown; |
| 206 |
intervalCount = storedIntervalCount; |
| 207 |
} else if (treesSet != null) { |
| 208 |
treesSet.restoreTheState(); |
| 209 |
} |
| 210 |
|
| 211 |
likelihoodKnown = storedLikelihoodKnown; |
| 212 |
logLikelihood = storedLogLikelihood; |
| 213 |
|
| 214 |
if (!intervalsKnown) { |
| 215 |
likelihoodKnown = false; |
| 216 |
} |
| 217 |
} |
| 218 |
|
| 219 |
protected final void acceptState() { |
| 220 |
} |
| 221 |
|
| 222 |
|
| 223 |
|
| 224 |
|
| 225 |
|
| 226 |
public final Model getModel() { |
| 227 |
return this; |
| 228 |
} |
| 229 |
|
| 230 |
public double getLogLikelihood() { |
| 231 |
if (!likelihoodKnown) { |
| 232 |
logLikelihood = calculateLogLikelihood(); |
| 233 |
likelihoodKnown = true; |
| 234 |
} |
| 235 |
return logLikelihood; |
| 236 |
} |
| 237 |
|
| 238 |
public final void makeDirty() { |
| 239 |
likelihoodKnown = false; |
| 240 |
intervalsKnown = false; |
| 241 |
} |
| 242 |
|
| 243 |
|
| 244 |
|
| 245 |
|
| 246 |
|
| 247 |
public double calculateLogLikelihood() { |
| 248 |
|
| 249 |
if (treesSet != null) { |
| 250 |
final int nTrees = treesSet.nLoci(); |
| 251 |
final DemographicFunction demogFunction = demoModel.getDemographicFunction(); |
| 252 |
double logLike = 0.0; |
| 253 |
for (int nt = 0; nt < nTrees; ++nt) { |
| 254 |
final double popFactor = treesSet.getPopulationFactor(nt); |
| 255 |
DemographicFunction df = popFactor != 1.0 ? |
| 256 |
new ScaledDemographic(demogFunction, popFactor) : demogFunction; |
| 257 |
|
| 258 |
logLike += Coalescent.calculateLogLikelihood(treesSet.getTreeIntervals(nt), df); |
| 259 |
} |
| 260 |
return logLike; |
| 261 |
} |
| 262 |
|
| 263 |
if (!intervalsKnown) setupIntervals(); |
| 264 |
|
| 265 |
if (demoModel == null) return calculateAnalyticalLogLikelihood(); |
| 266 |
|
| 267 |
double logL = 0.0; |
| 268 |
|
| 269 |
double currentTime = 0.0; |
| 270 |
|
| 271 |
DemographicFunction demoFunction = demoModel.getDemographicFunction(); |
| 272 |
|
| 273 |
for (int j = 0; j < intervalCount; j++) { |
| 274 |
|
| 275 |
logL += calculateIntervalLikelihood(demoFunction, intervals[j], currentTime, lineageCounts[j], |
| 276 |
getIntervalType(j)); |
| 277 |
|
| 278 |
|
| 279 |
final int diff = getCoalescentEvents(j) - 1; |
| 280 |
for (int k = 0; k < diff; k++) { |
| 281 |
logL += calculateIntervalLikelihood(demoFunction, 0.0, currentTime, lineageCounts[j] - k - 1, |
| 282 |
CoalescentEventType.COALESCENT); |
| 283 |
} |
| 284 |
|
| 285 |
currentTime += intervals[j]; |
| 286 |
} |
| 287 |
|
| 288 |
return logL; |
| 289 |
} |
| 290 |
|
| 291 |
private double calculateAnalyticalLogLikelihood() { |
| 292 |
|
| 293 |
final double lambda = getLambda(); |
| 294 |
final int n = tree.getExternalNodeCount(); |
| 295 |
|
| 296 |
|
| 297 |
|
| 298 |
|
| 299 |
|
| 300 |
|
| 301 |
|
| 302 |
return -(n - 1) * Math.log(lambda); |
| 303 |
} |
| 304 |
|
| 305 |
|
| 306 |
|
| 307 |
|
| 308 |
public final double calculateIntervalLikelihood(DemographicFunction demoFunction, double width, |
| 309 |
double timeOfPrevCoal, int lineageCount) { |
| 310 |
|
| 311 |
return calculateIntervalLikelihood(demoFunction, width, timeOfPrevCoal, lineageCount, |
| 312 |
CoalescentEventType.COALESCENT); |
| 313 |
} |
| 314 |
|
| 315 |
|
| 316 |
|
| 317 |
|
| 318 |
|
| 319 |
|
| 320 |
|
| 321 |
|
| 322 |
|
| 323 |
|
| 324 |
|
| 325 |
|
| 326 |
|
| 327 |
|
| 328 |
|
| 329 |
|
| 330 |
|
| 331 |
|
| 332 |
|
| 333 |
|
| 334 |
|
| 335 |
|
| 336 |
|
| 337 |
public static double calculateIntervalLikelihood(DemographicFunction demogFunction, |
| 338 |
double width, double timeOfPrevCoal, int lineageCount, |
| 339 |
CoalescentEventType type) { |
| 340 |
final double timeOfThisCoal = width + timeOfPrevCoal; |
| 341 |
|
| 342 |
final double intervalArea = demogFunction.getIntegral(timeOfPrevCoal, timeOfThisCoal); |
| 343 |
final double kchoose2 = Binomial.choose2(lineageCount); |
| 344 |
double like = -kchoose2 * intervalArea; |
| 345 |
|
| 346 |
switch (type) { |
| 347 |
case COALESCENT: |
| 348 |
final double demographic = demogFunction.getLogDemographic(timeOfThisCoal); |
| 349 |
like += -demographic; |
| 350 |
|
| 351 |
break; |
| 352 |
case NEW_SAMPLE: |
| 353 |
break; |
| 354 |
} |
| 355 |
|
| 356 |
return like; |
| 357 |
} |
| 358 |
|
| 359 |
|
| 360 |
|
| 361 |
|
| 362 |
|
| 363 |
public final double calculateIntervalShapeParameter(DemographicFunction demogFunction, |
| 364 |
double width, double timeOfPrevCoal, int lineageCount, CoalescentEventType type) { |
| 365 |
switch (type) { |
| 366 |
case COALESCENT: |
| 367 |
return 1.0; |
| 368 |
case NEW_SAMPLE: |
| 369 |
return 0.0; |
| 370 |
} |
| 371 |
throw new Error("Unknown event found"); |
| 372 |
} |
| 373 |
|
| 374 |
|
| 375 |
|
| 376 |
|
| 377 |
|
| 378 |
public final double calculateIntervalRateParameter(DemographicFunction demogFunction, double width, |
| 379 |
double timeOfPrevCoal, int lineageCount, CoalescentEventType type) { |
| 380 |
final double timeOfThisCoal = width + timeOfPrevCoal; |
| 381 |
final double intervalArea = demogFunction.getIntegral(timeOfPrevCoal, timeOfThisCoal); |
| 382 |
return Binomial.choose2(lineageCount) * intervalArea; |
| 383 |
} |
| 384 |
|
| 385 |
|
| 386 |
|
| 387 |
|
| 388 |
|
| 389 |
|
| 390 |
|
| 391 |
private double getLambda() { |
| 392 |
double lambda = 0.0; |
| 393 |
for (int i = 0; i < getIntervalCount(); i++) { |
| 394 |
lambda += (intervals[i] * lineageCounts[i]); |
| 395 |
} |
| 396 |
lambda /= 2; |
| 397 |
|
| 398 |
return lambda; |
| 399 |
} |
| 400 |
|
| 401 |
|
| 402 |
|
| 403 |
|
| 404 |
|
| 405 |
public final void setupIntervals() { |
| 406 |
|
| 407 |
if (intervals == null) { |
| 408 |
int maxIntervalCount = tree.getNodeCount(); |
| 409 |
|
| 410 |
intervals = new double[maxIntervalCount]; |
| 411 |
lineageCounts = new int[maxIntervalCount]; |
| 412 |
storedIntervals = new double[maxIntervalCount]; |
| 413 |
storedLineageCounts = new int[maxIntervalCount]; |
| 414 |
} |
| 415 |
|
| 416 |
XTreeIntervals ti = new XTreeIntervals(intervals, lineageCounts); |
| 417 |
getTreeIntervals(tree, getMRCAOfCoalescent(tree), getExcludedMRCAs(tree), ti); |
| 418 |
intervalCount = ti.nIntervals; |
| 419 |
|
| 420 |
intervalsKnown = true; |
| 421 |
} |
| 422 |
|
| 423 |
|
| 424 |
|
| 425 |
|
| 426 |
|
| 427 |
|
| 428 |
|
| 429 |
|
| 430 |
|
| 431 |
|
| 432 |
|
| 433 |
|
| 434 |
|
| 435 |
private static void collectAllTimes(Tree tree, NodeRef top, NodeRef[] excludeBelow, |
| 436 |
ArrayList<ComparableDouble> times, ArrayList<Integer> childs) { |
| 437 |
|
| 438 |
times.add(new ComparableDouble(tree.getNodeHeight(top))); |
| 439 |
childs.add(tree.getChildCount(top)); |
| 440 |
|
| 441 |
for (int i = 0; i < tree.getChildCount(top); i++) { |
| 442 |
NodeRef child = tree.getChild(top, i); |
| 443 |
if (excludeBelow == null) { |
| 444 |
collectAllTimes(tree, child, excludeBelow, times, childs); |
| 445 |
} else { |
| 446 |
|
| 447 |
boolean include = true; |
| 448 |
for (NodeRef anExcludeBelow : excludeBelow) { |
| 449 |
if (anExcludeBelow.getNumber() == child.getNumber()) { |
| 450 |
include = false; |
| 451 |
break; |
| 452 |
} |
| 453 |
} |
| 454 |
if (include) |
| 455 |
collectAllTimes(tree, child, excludeBelow, times, childs); |
| 456 |
} |
| 457 |
} |
| 458 |
} |
| 459 |
|
| 460 |
private class XTreeIntervals { |
| 461 |
|
| 462 |
public XTreeIntervals(double[] intervals, int[] lineageCounts) { |
| 463 |
this.intervals = intervals; |
| 464 |
this.lineagesCount = lineageCounts; |
| 465 |
} |
| 466 |
|
| 467 |
int nIntervals; |
| 468 |
final int[] lineagesCount; |
| 469 |
final double[] intervals; |
| 470 |
|
| 471 |
} |
| 472 |
|
| 473 |
private static void getTreeIntervals(Tree tree, NodeRef root, NodeRef[] exclude, XTreeIntervals ti) { |
| 474 |
double MULTIFURCATION_LIMIT = 1e-9; |
| 475 |
|
| 476 |
ArrayList<ComparableDouble> times = new ArrayList<ComparableDouble>(); |
| 477 |
ArrayList<Integer> childs = new ArrayList<Integer>(); |
| 478 |
collectAllTimes(tree, root, exclude, times, childs); |
| 479 |
int[] indices = new int[times.size()]; |
| 480 |
|
| 481 |
HeapSort.sort(times, indices); |
| 482 |
|
| 483 |
final double[] intervals = ti.intervals; |
| 484 |
final int[] lineageCounts = ti.lineagesCount; |
| 485 |
|
| 486 |
|
| 487 |
double start = times.get(indices[0]).doubleValue(); |
| 488 |
int numLines = 0; |
| 489 |
int i = 0; |
| 490 |
int intervalCount = 0; |
| 491 |
while (i < times.size()) { |
| 492 |
|
| 493 |
int lineagesRemoved = 0; |
| 494 |
int lineagesAdded = 0; |
| 495 |
|
| 496 |
final double finish = times.get(indices[i]).doubleValue(); |
| 497 |
double next = finish; |
| 498 |
|
| 499 |
while (Math.abs(next - finish) < MULTIFURCATION_LIMIT) { |
| 500 |
final int children = childs.get(indices[i]); |
| 501 |
if (children == 0) { |
| 502 |
lineagesAdded += 1; |
| 503 |
} else { |
| 504 |
lineagesRemoved += (children - 1); |
| 505 |
} |
| 506 |
i += 1; |
| 507 |
if (i == times.size()) break; |
| 508 |
|
| 509 |
next = times.get(indices[i]).doubleValue(); |
| 510 |
} |
| 511 |
|
| 512 |
if (lineagesAdded > 0) { |
| 513 |
|
| 514 |
if (intervalCount > 0 || ((finish - start) > MULTIFURCATION_LIMIT)) { |
| 515 |
intervals[intervalCount] = finish - start; |
| 516 |
lineageCounts[intervalCount] = numLines; |
| 517 |
intervalCount += 1; |
| 518 |
} |
| 519 |
|
| 520 |
start = finish; |
| 521 |
} |
| 522 |
|
| 523 |
numLines += lineagesAdded; |
| 524 |
|
| 525 |
if (lineagesRemoved > 0) { |
| 526 |
|
| 527 |
intervals[intervalCount] = finish - start; |
| 528 |
lineageCounts[intervalCount] = numLines; |
| 529 |
intervalCount += 1; |
| 530 |
start = finish; |
| 531 |
} |
| 532 |
|
| 533 |
numLines -= lineagesRemoved; |
| 534 |
} |
| 535 |
|
| 536 |
ti.nIntervals = intervalCount; |
| 537 |
} |
| 538 |
|
| 539 |
|
| 540 |
|
| 541 |
|
| 542 |
public final int getIntervalCount() { |
| 543 |
return intervalCount; |
| 544 |
} |
| 545 |
|
| 546 |
|
| 547 |
|
| 548 |
|
| 549 |
|
| 550 |
|
| 551 |
|
| 552 |
public final double getInterval(int i) { |
| 553 |
if (i >= intervalCount) throw new IllegalArgumentException(); |
| 554 |
return intervals[i]; |
| 555 |
} |
| 556 |
|
| 557 |
|
| 558 |
|
| 559 |
|
| 560 |
|
| 561 |
|
| 562 |
|
| 563 |
|
| 564 |
|
| 565 |
public final int getLineageCount(int i) { |
| 566 |
if (i >= intervalCount) throw new IllegalArgumentException(); |
| 567 |
return lineageCounts[i]; |
| 568 |
} |
| 569 |
|
| 570 |
|
| 571 |
|
| 572 |
|
| 573 |
|
| 574 |
public final int getCoalescentEvents(int i) { |
| 575 |
|
| 576 |
if (i >= intervalCount) throw new IllegalArgumentException(); |
| 577 |
if (i < intervalCount - 1) { |
| 578 |
return lineageCounts[i] - lineageCounts[i + 1]; |
| 579 |
} else { |
| 580 |
return lineageCounts[i] - 1; |
| 581 |
} |
| 582 |
} |
| 583 |
|
| 584 |
|
| 585 |
|
| 586 |
|
| 587 |
|
| 588 |
public final CoalescentEventType getIntervalType(int i) { |
| 589 |
|
| 590 |
if (i >= intervalCount) throw new IllegalArgumentException(); |
| 591 |
int numEvents = getCoalescentEvents(i); |
| 592 |
|
| 593 |
if (numEvents > 0) return CoalescentEventType.COALESCENT; |
| 594 |
else if (numEvents < 0) return CoalescentEventType.NEW_SAMPLE; |
| 595 |
else return CoalescentEventType.NOTHING; |
| 596 |
} |
| 597 |
|
| 598 |
|
| 599 |
|
| 600 |
|
| 601 |
|
| 602 |
public final double getTotalHeight() { |
| 603 |
|
| 604 |
double height = 0.0; |
| 605 |
for (int j = 0; j < intervalCount; j++) { |
| 606 |
height += intervals[j]; |
| 607 |
} |
| 608 |
return height; |
| 609 |
} |
| 610 |
|
| 611 |
|
| 612 |
|
| 613 |
|
| 614 |
|
| 615 |
|
| 616 |
public final boolean isBinaryCoalescent() { |
| 617 |
for (int i = 0; i < intervalCount; i++) { |
| 618 |
if (getCoalescentEvents(i) != 1) return false; |
| 619 |
} |
| 620 |
|
| 621 |
return true; |
| 622 |
} |
| 623 |
|
| 624 |
|
| 625 |
|
| 626 |
|
| 627 |
|
| 628 |
|
| 629 |
public final boolean isCoalescentOnly() { |
| 630 |
for (int i = 0; i < intervalCount; i++) { |
| 631 |
if (getCoalescentEvents(i) < 1) return false; |
| 632 |
} |
| 633 |
return true; |
| 634 |
} |
| 635 |
|
| 636 |
public String toString() { |
| 637 |
return getId(); |
| 638 |
} |
| 639 |
|
| 640 |
|
| 641 |
|
| 642 |
|
| 643 |
|
| 644 |
|
| 645 |
|
| 646 |
|
| 647 |
|
| 648 |
public final void setUnits(Type u) { |
| 649 |
demoModel.setUnits(u); |
| 650 |
} |
| 651 |
|
| 652 |
|
| 653 |
|
| 654 |
|
| 655 |
|
| 656 |
public final Type getUnits() { |
| 657 |
return demoModel.getUnits(); |
| 658 |
} |
| 659 |
|
| 660 |
public final boolean getIntervalsKnown() { |
| 661 |
return intervalsKnown; |
| 662 |
} |
| 663 |
|
| 664 |
|
| 665 |
|
| 666 |
|
| 667 |
|
| 668 |
public class DeltaStatistic extends Statistic.Abstract { |
| 669 |
|
| 670 |
public DeltaStatistic() { |
| 671 |
super("delta"); |
| 672 |
} |
| 673 |
|
| 674 |
public int getDimension() { |
| 675 |
return 1; |
| 676 |
} |
| 677 |
|
| 678 |
public double getStatisticValue(int i) { |
| 679 |
throw new RuntimeException("Not implemented"); |
| 680 |
|
| 681 |
} |
| 682 |
|
| 683 |
} |
| 684 |
|
| 685 |
|
| 686 |
|
| 687 |
|
| 688 |
|
| 689 |
|
| 690 |
|
| 691 |
|
| 692 |
|
| 693 |
|
| 694 |
|
| 695 |
|
| 696 |
|
| 697 |
|
| 698 |
|
| 699 |
|
| 700 |
|
| 701 |
|
| 702 |
|
| 703 |
|
| 704 |
|
| 705 |
|
| 706 |
|
| 707 |
|
| 708 |
|
| 709 |
|
| 710 |
|
| 711 |
|
| 712 |
|
| 713 |
|
| 714 |
|
| 715 |
|
| 716 |
|
| 717 |
|
| 718 |
|
| 719 |
|
| 720 |
|
| 721 |
|
| 722 |
|
| 723 |
|
| 724 |
|
| 725 |
|
| 726 |
|
| 727 |
|
| 728 |
|
| 729 |
|
| 730 |
|
| 731 |
|
| 732 |
|
| 733 |
|
| 734 |
|
| 735 |
|
| 736 |
|
| 737 |
|
| 738 |
|
| 739 |
|
| 740 |
|
| 741 |
|
| 742 |
|
| 743 |
|
| 744 |
|
| 745 |
|
| 746 |
|
| 747 |
|
| 748 |
|
| 749 |
|
| 750 |
|
| 751 |
|
| 752 |
|
| 753 |
|
| 754 |
|
| 755 |
|
| 756 |
|
| 757 |
|
| 758 |
|
| 759 |
|
| 760 |
|
| 761 |
|
| 762 |
|
| 763 |
|
| 764 |
|
| 765 |
|
| 766 |
|
| 767 |
|
| 768 |
|
| 769 |
|
| 770 |
|
| 771 |
|
| 772 |
|
| 773 |
|
| 774 |
|
| 775 |
|
| 776 |
|
| 777 |
|
| 778 |
|
| 779 |
|
| 780 |
|
| 781 |
|
| 782 |
|
| 783 |
|
| 784 |
|
| 785 |
|
| 786 |
|
| 787 |
|
| 788 |
|
| 789 |
|
| 790 |
|
| 791 |
|
| 792 |
|
| 793 |
|
| 794 |
|
| 795 |
|
| 796 |
|
| 797 |
|
| 798 |
|
| 799 |
|
| 800 |
|
| 801 |
|
| 802 |
|
| 803 |
|
| 804 |
|
| 805 |
|
| 806 |
|
| 807 |
|
| 808 |
|
| 809 |
|
| 810 |
|
| 811 |
|
| 812 |
|
| 813 |
|
| 814 |
private DemographicModel demoModel = null; |
| 815 |
|
| 816 |
|
| 817 |
|
| 818 |
|
| 819 |
Tree tree = null; |
| 820 |
|
| 821 |
|
| 822 |
|
| 823 |
|
| 824 |
double[] intervals; |
| 825 |
private double[] storedIntervals; |
| 826 |
|
| 827 |
|
| 828 |
|
| 829 |
|
| 830 |
int[] lineageCounts; |
| 831 |
private int[] storedLineageCounts; |
| 832 |
|
| 833 |
boolean intervalsKnown = false; |
| 834 |
private boolean storedIntervalsKnown = false; |
| 835 |
|
| 836 |
double logLikelihood; |
| 837 |
private double storedLogLikelihood; |
| 838 |
boolean likelihoodKnown = false; |
| 839 |
private boolean storedLikelihoodKnown = false; |
| 840 |
|
| 841 |
int intervalCount = 0; |
| 842 |
private int storedIntervalCount = 0; |
| 843 |
} |