Skip to content

Commit

Permalink
Merged changes in BetaApproximationLikelihood.java
Browse files Browse the repository at this point in the history
  • Loading branch information
David Bryant authored and David Bryant committed May 12, 2015
2 parents 56ecc28 + 9985244 commit 8ab4d5d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/snap/Data.java
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ public double getProportionZeros() {
int w = getPatternWeight(i);
for (int j = 0; j < p.length; j++) {
oneCount += w * p[j];
zeroCount += w * (n[j] - p[j]);
zeroCount += w * (n[j] - 1 - p[j]);
}
}
return (double) zeroCount / ((double) zeroCount + oneCount);
Expand Down
12 changes: 12 additions & 0 deletions src/snap/likelihood/BetaApproximationLikelihood.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ public class BetaApproximationLikelihood extends GenericTreeLikelihood {


Tree tree;
<<<<<<< HEAD
Double rootAlpha; //Parameter for root distribution.
=======
Double rootTheta; //Parameter for root distribution.
>>>>>>> 998524460c43138ca5124e4ba57b30d99803bf95
Data data;

int nPoints; //Size of mesh used in integration
Expand Down Expand Up @@ -62,6 +66,10 @@ public void initAndValidate() throws Exception {
nPoints = 20; //TODO: read this from the xml
int nNodes = tree.getNodeCount();
partialIntegral = new double[nPoints][nNodes];
<<<<<<< HEAD
=======
rootTheta = 0.5; //We should get this from the PARAMETERS.
>>>>>>> 998524460c43138ca5124e4ba57b30d99803bf95

hasDirt = Tree.IS_FILTHY;
}
Expand Down Expand Up @@ -231,7 +239,11 @@ private double transProb(double x,double y, double t) {
}

private double rootProb(double x) {
<<<<<<< HEAD
return betaDensity(x,rootAlpha,rootAlpha);
=======
return betaDensity(x,rootTheta,rootTheta);
>>>>>>> 998524460c43138ca5124e4ba57b30d99803bf95
}


Expand Down

0 comments on commit 8ab4d5d

Please sign in to comment.