Skip to content

Commit

Permalink
Change the datatype of negr for int to double #56
Browse files Browse the repository at this point in the history
  • Loading branch information
zjzxiaohei committed Jan 12, 2025
1 parent c4cc448 commit 776b782
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public class LikelihoodReadCountModel extends Distribution {
private double variance2;
private double negp1;
private double negp2;
private int negr1;
private int negr2;
private double negr1;
private double negr2;
private Double[][] propensities;


Expand Down Expand Up @@ -117,8 +117,8 @@ public double calculateLogP() {
this.variance2 = mean2 + Math.pow(this.alpha2, 2) * vv * Math.pow(sv, 2);
this.negp1 = this.mean1 / this.variance1;
this.negp2 = this.mean2 / this.variance2;
this.negr1 = Math.round((float) (Math.pow(this.mean1, 2) / (this.variance1 - this.mean1)));
this.negr2 = Math.round((float) (Math.pow(this.mean2, 2) / (this.variance2 - this.mean2)));
this.negr1 = Math.pow(this.mean1, 2) / (this.variance1 - this.mean1);
this.negr2 = Math.pow(this.mean2, 2) / (this.variance2 - this.mean2);
for (int j = 0; j < alignmentInput.get().getSiteCount(); j++) {///?
// dirichlet multinomial pmf
int patternIndex = alignmentInput.get().getPatternIndex(j);
Expand Down Expand Up @@ -209,7 +209,7 @@ public double logLiklihoodRC(int genotypeState, int[] readCountNumbers, double w
return logLikelihood;
}
//calculate the probability at each site given read count(coverage)(negative-binomial distribution)
public double logCoverageLikelihood(int[] readCountNumbers, double p, int r) {
public double logCoverageLikelihood(int[] readCountNumbers, double p, double r) {
// negative binomial pmf
double logCoverageLikelihood;
int c = 0;
Expand Down

0 comments on commit 776b782

Please sign in to comment.