Skip to content

Commit

Permalink
Make origin input not required. Closes #2.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gavryushkina Alexandra committed Nov 4, 2016
1 parent ac90c16 commit 6aae2ba
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/beast/evolution/speciation/SABirthDeathModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class SABirthDeathModel extends SpeciesTreeDistribution {

//'direct' parameters
public Input<RealParameter> originInput =
new Input<RealParameter>("origin", "The time when the process started", Input.Validate.REQUIRED);
new Input<RealParameter>("origin", "The time when the process started", (RealParameter)null);
public Input<RealParameter> birthRateInput =
new Input<RealParameter>("birthRate", "Birth rate", Input.Validate.REQUIRED);
public Input<RealParameter> deathRateInput =
Expand Down Expand Up @@ -291,6 +291,10 @@ public double calculateTreeLogLikelihood(TreeInterface tree)
if (lambdaExceedsMu && lambda <= mu) {
return Double.NEGATIVE_INFINITY;
}

if (lambda < 0 || mu < 0 || psi < 0) {
return Double.NEGATIVE_INFINITY;
}
//double x0 = tree.getRoot().getHeight() + origToRootDistance;
double x0 = origin;
double x1=tree.getRoot().getHeight();
Expand Down

0 comments on commit 6aae2ba

Please sign in to comment.