Skip to content

Commit 060a100

Browse files
committed
use gamma dist for col rates with mean 1
1 parent e7fabc6 commit 060a100

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎src/asr/Mip.java‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import bn.ctmc.GapSubstModel;
44
import bn.ctmc.matrix.*;
5+
import bn.prob.GammaDistrib;
56
import com.google.ortools.Loader;
67
import com.google.ortools.linearsolver.MPConstraint;
78
import com.google.ortools.linearsolver.MPObjective;
@@ -25,7 +26,7 @@
2526
public class Mip {
2627

2728
private static final double MAX_PENALTY = 1000.0;
28-
private static final int NUM_GAMMA_CATEGORIES = 20;
29+
private static final int NUM_GAMMA_CATEGORIES = 10;
2930
public static double MIN_MU_LAMBDA_VALUE = 0;
3031
public static double MAX_MU_LAMBDA_VALUE = 0.25;
3132
private static final int GAP = 0;
@@ -316,8 +317,9 @@ private double[][] createTreeNeighbourAlphaPen() {
316317
double[] ratePriors;
317318

318319
if (rateSampleCollection.length > 0) {
319-
RateModel indelRateDist = RateModel.bestfit(rateSampleCollection, 42);
320-
rates = indelRateDist.getMeanGammaRates(NUM_GAMMA_CATEGORIES);
320+
ZeroInflatedGamma zig = ZeroInflatedGamma.fitMLE(rateSampleCollection, 42);
321+
GammaDistrib gd = new GammaDistrib(zig.getShape(), zig.getShape(), 42);
322+
rates = gd.getMeanGammaRates(NUM_GAMMA_CATEGORIES);
321323

322324
} else {
323325
rates = new double[NUM_GAMMA_CATEGORIES];

0 commit comments

Comments
 (0)