use of dr.inference.distribution.ExponentialDistributionModel in project beast-mcmc by beast-dev.
the class PartitionData method createClockRateModel.
public BranchRateModel createClockRateModel() {
BranchRateModel branchRateModel = null;
if (this.clockModelIndex == 0) {
// Strict Clock
Parameter rateParameter = new Parameter.Default(1, clockParameterValues[0]);
branchRateModel = new StrictClockBranchRates(rateParameter);
} else if (this.clockModelIndex == LRC_INDEX) {
// Lognormal relaxed clock
double numberOfBranches = 2 * (createTreeModel().getTaxonCount() - 1);
Parameter rateCategoryParameter = new Parameter.Default(numberOfBranches);
Parameter mean = new Parameter.Default(LogNormalDistributionModelParser.MEAN, 1, clockParameterValues[1]);
Parameter stdev = new Parameter.Default(LogNormalDistributionModelParser.STDEV, 1, clockParameterValues[2]);
//TODO: choose between log scale / real scale
ParametricDistributionModel distributionModel = new LogNormalDistributionModel(mean, stdev, clockParameterValues[3], lrcParametersInRealSpace, lrcParametersInRealSpace);
branchRateModel = new //
DiscretizedBranchRates(//
createTreeModel(), //
rateCategoryParameter, //
distributionModel, //
1, //
false, //
Double.NaN, //randomizeRates
true, // keepRates
false, // cacheRates
false);
} else if (this.clockModelIndex == 2) {
// Exponential relaxed clock
double numberOfBranches = 2 * (createTreeModel().getTaxonCount() - 1);
Parameter rateCategoryParameter = new Parameter.Default(numberOfBranches);
Parameter mean = new Parameter.Default(DistributionModelParser.MEAN, 1, clockParameterValues[4]);
ParametricDistributionModel distributionModel = new ExponentialDistributionModel(mean, clockParameterValues[5]);
// branchRateModel = new DiscretizedBranchRates(createTreeModel(), rateCategoryParameter,
// distributionModel, 1, false, Double.NaN);
branchRateModel = new //
DiscretizedBranchRates(//
createTreeModel(), //
rateCategoryParameter, //
distributionModel, //
1, //
false, //
Double.NaN, //randomizeRates
true, // keepRates
false, // cacheRates
false);
} else if (this.clockModelIndex == 3) {
// Inverse Gaussian
double numberOfBranches = 2 * (createTreeModel().getTaxonCount() - 1);
Parameter rateCategoryParameter = new Parameter.Default(numberOfBranches);
Parameter mean = new Parameter.Default(InverseGaussianDistributionModelParser.MEAN, 1, clockParameterValues[6]);
Parameter stdev = new Parameter.Default(InverseGaussianDistributionModelParser.STDEV, 1, clockParameterValues[7]);
ParametricDistributionModel distributionModel = new InverseGaussianDistributionModel(mean, stdev, clockParameterValues[8], false);
branchRateModel = new //
DiscretizedBranchRates(//
createTreeModel(), //
rateCategoryParameter, //
distributionModel, //
1, //
false, //
Double.NaN, //randomizeRates
true, // keepRates
false, // cacheRates
false);
} else {
System.out.println("Not yet implemented");
}
return branchRateModel;
}
Aggregations