当前位置: 首页>>代码示例>>Java>>正文


Java RealParameter.getLower方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:genomescale,项目名称:starbeast2,代码行数:24,代码来源:LinearWithConstantRoot.java

示例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;
}
 
开发者ID:jessiewu,项目名称:substBMA,代码行数:30,代码来源:ExtendedRealRandomWalkOperator.java

示例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;
    }
 
开发者ID:jessiewu,项目名称:substBMA,代码行数:26,代码来源:SpecificRealRandomWalkOperator.java

示例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;
}
 
开发者ID:nicfel,项目名称:Mascot,代码行数:38,代码来源:RealRandomWalkOperator.java

示例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);
}
 
开发者ID:mrc-ide,项目名称:PhyDyn,代码行数:8,代码来源:ABCOperator.java

示例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();
}
 
开发者ID:genomescale,项目名称:starbeast2,代码行数:13,代码来源:NetworkRateExchange.java

示例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);
     }
    }
}
 
开发者ID:genomescale,项目名称:starbeast2,代码行数:13,代码来源:ConstantPopulations.java

示例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;
}
 
开发者ID:CompEvol,项目名称:beast2,代码行数:31,代码来源:RealRandomWalkOperator.java

示例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);
}
 
开发者ID:CompEvol,项目名称:beast2,代码行数:10,代码来源:StarBeastStartState.java

示例10: in_range

import beast.core.parameter.RealParameter; //导入方法依赖的package包/类
boolean in_range(RealParameter X, double x) {
    return (X.getLower() < x && x < X.getUpper());
}
 
开发者ID:CompEvol,项目名称:beast2,代码行数:4,代码来源:SliceOperator.java

示例11: below_lower_bound

import beast.core.parameter.RealParameter; //导入方法依赖的package包/类
boolean below_lower_bound(RealParameter X, double x) {
    return (x < X.getLower());
}
 
开发者ID:CompEvol,项目名称:beast2,代码行数:4,代码来源:SliceOperator.java


注:本文中的beast.core.parameter.RealParameter.getLower方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。