本文整理汇总了Java中beast.core.parameter.RealParameter.getLower方法的典型用法代码示例。如果您正苦于以下问题:Java RealParameter.getLower方法的具体用法?Java RealParameter.getLower怎么用?Java RealParameter.getLower使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类beast.core.parameter.RealParameter
的用法示例。
在下文中一共展示了RealParameter.getLower方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initPopSizes
import beast.core.parameter.RealParameter; //导入方法依赖的package包/类
@Override
public void initPopSizes(double tipInitial) {
final double topInitial = tipInitial * 0.5;
final RealParameter tipPopSizes = tipPopSizesInput.get();
final RealParameter topPopSizes = topPopSizesInput.get();
final double tipLower = tipPopSizes.getLower();
final double tipUpper = tipPopSizes.getUpper();
final double topLower = topPopSizes.getLower();
final double topUpper = topPopSizes.getUpper();
if (tipPopSizes.isEstimatedInput.get() && tipInitial > tipLower && tipInitial < tipUpper) {
for (int i = 0; i < tipPopSizes.getDimension(); i++)
tipPopSizes.setValue(i, tipInitial);
}
if (topPopSizes.isEstimatedInput.get() && topInitial > topLower && topInitial < topUpper) {
for (int i = 0; i < topPopSizes.getDimension(); i++)
topPopSizes.setValue(i, topInitial);
}
}
示例2: proposal
import beast.core.parameter.RealParameter; //导入方法依赖的package包/类
/**
* override this for proposals,
* returns log of hastingRatio, or Double.NEGATIVE_INFINITY if proposal should not be accepted *
*/
@Override
public double proposal() {
RealParameter param = parameterInput.get(this);
int i = Randomizer.nextInt(param.getDimension());
double value = param.getValue(i);
double newValue = getProposedVal(
value, //original value
i, //index of the value
useGaussian, //whether to use gaussian moves
windowSizes); //window sizes
if (newValue < param.getLower() || newValue > param.getUpper()) {
return Double.NEGATIVE_INFINITY;
}
if (newValue == value) {
// this saves calculating the posterior
return Double.NEGATIVE_INFINITY;
}
param.setValue(i, newValue);
lastChangedValueIndex = i;
return 0.0;
}
示例3: proposal
import beast.core.parameter.RealParameter; //导入方法依赖的package包/类
public double proposal() {
RealParameter param = parameterInput.get(this);
double value = param.getValue(index);
double newValue = value;
if (useGaussian) {
newValue += Randomizer.nextGaussian() * windowSize;
} else {
newValue += Randomizer.nextDouble() * 2 * windowSize - windowSize;
}
if (newValue < param.getLower() || newValue > param.getUpper()) {
return Double.NEGATIVE_INFINITY;
}
if (newValue == value) {
// this saves calculating the posterior
return Double.NEGATIVE_INFINITY;
}
param.setValue(index, newValue);
return 0.0;
}
示例4: proposal
import beast.core.parameter.RealParameter; //导入方法依赖的package包/类
/**
* override this for proposals,
* returns log of hastingRatio, or Double.NEGATIVE_INFINITY if proposal should not be accepted *
*/
@Override
public double proposal() {
RealParameter param = parameterInput.get(this);
for (int i = 0; i < param.getDimension(); i++){
double value = param.getValue(i);
double newValue = value;
double windowSize = 0.0;
if (indicatorInput.get().getArrayValue(i) > 0.5)
windowSize = windowSizeOn;
else
windowSize = windowSizeOff;
if (useGaussian) {
newValue += Randomizer.nextGaussian() * windowSize;
} else {
newValue += Randomizer.nextDouble() * 2 * windowSize - windowSize;
}
if (newValue < param.getLower() || newValue > param.getUpper()) {
return Double.NEGATIVE_INFINITY;
}
if (newValue == value) {
// this saves calculating the posterior
return Double.NEGATIVE_INFINITY;
}
param.setValue(i, newValue);
}
return 0.0;
}
示例5: outsideBounds
import beast.core.parameter.RealParameter; //导入方法依赖的package包/类
protected boolean outsideBounds(final double value, final RealParameter param) {
final Double l = param.getLower();
final Double h = param.getUpper();
return (value < l || value > h);
//return (l != null && value < l || h != null && value > h);
}
示例6: initAndValidate
import beast.core.parameter.RealParameter; //导入方法依赖的package包/类
@Override
public void initAndValidate() {
final RealParameter treeRates = treeRatesInput.get();
nNodes = treeRates.getDimension();
lowerBound = treeRates.getLower();
upperBound = treeRates.getUpper();
deltaScaleFactor = 2.0 * deltaInput.get() / nNodes;
setLimits(2, nNodes);
super.initAndValidate();
}
示例7: initPopSizes
import beast.core.parameter.RealParameter; //导入方法依赖的package包/类
@Override
public void initPopSizes(double popInitial) {
final RealParameter popSizes = popSizesInput.get();
final double lower = popSizes.getLower();
final double upper = popSizes.getUpper();
if (popSizes.isEstimatedInput.get() && popInitial > lower && popInitial < upper) {
for (int i = 0; i < popSizes.getDimension(); i++) {
popSizes.setValue(i, popInitial);
}
}
}
示例8: proposal
import beast.core.parameter.RealParameter; //导入方法依赖的package包/类
/**
* override this for proposals,
* returns log of hastingRatio, or Double.NEGATIVE_INFINITY if proposal should not be accepted *
*/
@Override
public double proposal() {
RealParameter param = parameterInput.get(this);
int i = Randomizer.nextInt(param.getDimension());
double value = param.getValue(i);
double newValue = value;
if (useGaussian) {
newValue += Randomizer.nextGaussian() * windowSize;
} else {
newValue += Randomizer.nextDouble() * 2 * windowSize - windowSize;
}
if (newValue < param.getLower() || newValue > param.getUpper()) {
return Double.NEGATIVE_INFINITY;
}
if (newValue == value) {
// this saves calculating the posterior
return Double.NEGATIVE_INFINITY;
}
param.setValue(i, newValue);
return 0.0;
}
示例9: setParameterValue
import beast.core.parameter.RealParameter; //导入方法依赖的package包/类
private void setParameterValue(RealParameter p, int index, double value) {
if (value < p.getLower()) {
value = p.getLower();
}
if (value > p.getUpper()) {
value = p.getUpper();
}
p.setValue(index, value);
}
示例10: in_range
import beast.core.parameter.RealParameter; //导入方法依赖的package包/类
boolean in_range(RealParameter X, double x) {
return (X.getLower() < x && x < X.getUpper());
}
示例11: below_lower_bound
import beast.core.parameter.RealParameter; //导入方法依赖的package包/类
boolean below_lower_bound(RealParameter X, double x) {
return (x < X.getLower());
}