use of dr.evolution.datatype.DataType in project beast-mcmc by beast-dev.
the class TimeIrreversibleTest method testComplexSubstitutionModel.
private double[] testComplexSubstitutionModel(Original test, double[] rates) {
System.out.println("\n*** Complex Substitution Model Test: " + test + " ***");
Parameter ratesP = new Parameter.Default(rates);
DataType dataType = test.getDataType();
FrequencyModel freqModel = new FrequencyModel(dataType, new Parameter.Default(test.getFrequencies()));
ComplexSubstitutionModel substModel = new ComplexSubstitutionModel("Complex Substitution Model Test", dataType, freqModel, ratesP);
double logL = substModel.getLogLikelihood();
System.out.println("Prior = " + logL);
double[] finiteTimeProbs = null;
if (!Double.isInfinite(logL)) {
finiteTimeProbs = new double[substModel.getDataType().getStateCount() * substModel.getDataType().getStateCount()];
substModel.getTransitionProbabilities(time, finiteTimeProbs);
System.out.println("Probs = ");
printRateMatrix(finiteTimeProbs, substModel.getDataType().getStateCount());
}
// assertEquals(1, 1, 1e-10);
return finiteTimeProbs;
}
Aggregations