[beast-mcmc] r6728 committed - Added getInverseIntegral for simulation purposes (because getIntensity...

0 views
Skip to first unread message

beast...@googlecode.com

unread,
Apr 9, 2015, 8:40:19 AM4/9/15
to beast-...@googlegroups.com
Revision: 6728
Author: mdha...@gmail.com
Date: Thu Apr 9 12:40:06 2015 UTC
Log: Added getInverseIntegral for simulation purposes (because
getIntensity is infinite for these functions)
https://code.google.com/p/beast-mcmc/source/detail?r=6728

Modified:
/trunk/src/dr/evolution/coalescent/FlexibleGrowth.java
/trunk/src/dr/evolution/coalescent/LinearGrowth.java
/trunk/src/dr/evolution/coalescent/PowerLawGrowth.java
/trunk/src/dr/evomodelxml/coalescent/LinearGrowthModelParser.java

=======================================
--- /trunk/src/dr/evolution/coalescent/FlexibleGrowth.java Tue Apr 7
10:03:54 2015 UTC
+++ /trunk/src/dr/evolution/coalescent/FlexibleGrowth.java Thu Apr 9
12:40:06 2015 UTC
@@ -85,6 +85,10 @@
public double getInverseIntensity(double x) {
throw new RuntimeException("Not implemented");
}
+
+ public double getInverseIntegral(double x, double start) {
+ throw new RuntimeException("Not implemented");
+ }

public double getIntegral(double start, double finish) {

=======================================
--- /trunk/src/dr/evolution/coalescent/LinearGrowth.java Thu Apr 2
15:11:48 2015 UTC
+++ /trunk/src/dr/evolution/coalescent/LinearGrowth.java Thu Apr 9
12:40:06 2015 UTC
@@ -78,6 +78,12 @@
public double getIntegral(double start, double finish) {
return 1/getN0() * Math.log((-start)/(-finish));
}
+
+ public double getInverseIntegral(double x, double start){
+
+ return start*Math.exp(-(x*getN0()));
+
+ }

public int getNumArguments() {
return 1;
=======================================
--- /trunk/src/dr/evolution/coalescent/PowerLawGrowth.java Tue Apr 7
10:03:54 2015 UTC
+++ /trunk/src/dr/evolution/coalescent/PowerLawGrowth.java Thu Apr 9
12:40:06 2015 UTC
@@ -79,6 +79,10 @@
public double getInverseIntensity(double x) {
throw new RuntimeException("Not implemented");
}
+
+ public double getInverseIntegral(double x, double start) {
+ throw new RuntimeException("Not implemented");
+ }

public double getIntegral(double start, double finish) {

=======================================
--- /trunk/src/dr/evomodelxml/coalescent/LinearGrowthModelParser.java Thu
Apr 2 15:11:48 2015 UTC
+++ /trunk/src/dr/evomodelxml/coalescent/LinearGrowthModelParser.java Thu
Apr 9 12:40:06 2015 UTC
@@ -26,7 +26,7 @@
XMLObject cxo = xo.getChild(SLOPE);
Parameter slopeParam = (Parameter) cxo.getChild(Parameter.class);

- return new ConstantPopulationModel(slopeParam, units);
+ return new LinearGrowthModel(slopeParam, units);
}


Reply all
Reply to author
Forward
0 new messages