Search in sources :

Example 66 with DataType

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;
}
Also used : FrequencyModel(dr.oldevomodel.substmodel.FrequencyModel) SVSComplexSubstitutionModel(dr.oldevomodel.substmodel.SVSComplexSubstitutionModel) ComplexSubstitutionModel(dr.oldevomodel.substmodel.ComplexSubstitutionModel) Parameter(dr.inference.model.Parameter) DataType(dr.evolution.datatype.DataType)

Aggregations

DataType (dr.evolution.datatype.DataType)66 Parameter (dr.inference.model.Parameter)26 FrequencyModel (dr.evomodel.substmodel.FrequencyModel)11 FrequencyModel (dr.oldevomodel.substmodel.FrequencyModel)11 ArrayList (java.util.ArrayList)8 Sequence (dr.evolution.sequence.Sequence)7 PartitionSubstitutionModel (dr.app.beauti.options.PartitionSubstitutionModel)4 PatternList (dr.evolution.alignment.PatternList)4 GeneralDataType (dr.evolution.datatype.GeneralDataType)4 Taxon (dr.evolution.util.Taxon)4 TaxonList (dr.evolution.util.TaxonList)4 GeneralSubstitutionModel (dr.evomodel.substmodel.GeneralSubstitutionModel)4 SVSComplexSubstitutionModel (dr.oldevomodel.substmodel.SVSComplexSubstitutionModel)4 Attribute (dr.util.Attribute)4 Codons (dr.evolution.datatype.Codons)3 HiddenDataType (dr.evolution.datatype.HiddenDataType)3 NodeRef (dr.evolution.tree.NodeRef)3 Tree (dr.evolution.tree.Tree)3 BranchRateModel (dr.evomodel.branchratemodel.BranchRateModel)3 SubstitutionModel (dr.evomodel.substmodel.SubstitutionModel)3