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


Java DescriptiveStatistics.getN方法代码示例

本文整理汇总了Java中org.apache.commons.math3.stat.descriptive.DescriptiveStatistics.getN方法的典型用法代码示例。如果您正苦于以下问题:Java DescriptiveStatistics.getN方法的具体用法?Java DescriptiveStatistics.getN怎么用?Java DescriptiveStatistics.getN使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.commons.math3.stat.descriptive.DescriptiveStatistics的用法示例。


在下文中一共展示了DescriptiveStatistics.getN方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: phi

import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics; //导入方法依赖的package包/类
/**
 * Compute phi for the specified node id.
 * @param nodeId node id
 * @return phi value
 */
public double phi(NodeId nodeId) {
    checkNotNull(nodeId, "NodeId must not be null");
    if (!states.containsKey(nodeId)) {
        return bootstrapPhiValue;
    }
    History nodeState = states.get(nodeId);
    synchronized (nodeState) {
        long latestHeartbeat = nodeState.latestHeartbeatTime();
        DescriptiveStatistics samples = nodeState.samples();
        if (latestHeartbeat == -1 || samples.getN() < minSamples) {
            return 0.0;
        }
        return computePhi(samples, latestHeartbeat, System.currentTimeMillis());
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:21,代码来源:PhiAccrualFailureDetector.java

示例2: computePhi

import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics; //导入方法依赖的package包/类
private double computePhi(DescriptiveStatistics samples, long tLast, long tNow) {
    long size = samples.getN();
    long t = tNow - tLast;
    return (size > 0)
            ? phiFactor * t / samples.getMean()
            : bootstrapPhiValue;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:8,代码来源:PhiAccrualFailureDetector.java

示例3: collectData

import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics; //导入方法依赖的package包/类
public void collectData()
{
	collectPopulationData();

	List<DescriptiveStatistics> allTdata = collectMoreTolData();
	DescriptiveStatistics tolstats = allTdata.get(0);
	DescriptiveStatistics ntolstats = allTdata.get(1);
	DescriptiveStatistics mtolstats = allTdata.get(2);

	double morans = calculateMoransI(meanBlue);
	double moranTol = calculateMoransT(tolstats.getMean());
	mC = morans;
	mT = moranTol;
	//print("<<collectData>> morans is " + morans + ", moranTol is " + moranTol);
	String moranStr = "" + morans;
	String moranTolStr = "" + moranTol;
	String globalHappyStr = "" + globalHappiness;
	String globalBlueHappy = "" + globalHappinessB;
	String globalGreenHappy = "" + globalHappinessG;
	String numAgentStr = "" + allAgents.size();
	String totalMoveStr = String.valueOf(globalMoveCounter);
	String numblue = String.valueOf(population[0]);
	String numgreen = String.valueOf(population[1]);
	String changedMindStr = "" + changedMind;

	String tolN = "" + tolstats.getN();
	String tolmean = "" + tolstats.getMean();
	String tolvar = "" + tolstats.getVariance();
	String tolstdDev = "" + tolstats.getStandardDeviation();
	String tolKurt = "" + tolstats.getKurtosis();
	String tolSkew = "" + tolstats.getSkewness();

	String ntolN = "" + ntolstats.getN();
	String ntolmean = "" + ntolstats.getMean();
	String ntolvar = "" + ntolstats.getVariance();
	String ntolstdDev = "" + ntolstats.getStandardDeviation();
	String ntolKurt = "" + ntolstats.getKurtosis();
	String ntolSkew = "" + ntolstats.getSkewness();

	String mtolN = "" + mtolstats.getN();
	String mtolmean = "" + mtolstats.getMean();
	String mtolvar = "" + mtolstats.getVariance();
	String mtolstdDev = "" + mtolstats.getStandardDeviation();
	String mtolKurt = "" + mtolstats.getKurtosis();
	String mtolSkew = "" + mtolstats.getSkewness();

	String theString[] = null;

	theString = new String[] { moranStr, moranTolStr, totalMoveStr, globalHappyStr, globalBlueHappy, globalGreenHappy, numAgentStr, numblue, numgreen, changedMindStr, tolN, tolmean, tolvar,
			tolstdDev, tolKurt, tolSkew, ntolN, ntolmean, ntolvar, ntolstdDev, ntolKurt, ntolSkew, mtolN, mtolmean, mtolvar, mtolstdDev, mtolKurt, mtolSkew };

	writer.writeNext(theString);
}
 
开发者ID:lursel,项目名称:ABM-adaptive-tolerance,代码行数:54,代码来源:Simulation.java

示例4: computeConfidenceInterval

import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics; //导入方法依赖的package包/类
private double computeConfidenceInterval(DescriptiveStatistics statistics, double significance)
{
    TDistribution tDist = new TDistribution(statistics.getN() - 1);
    double a = tDist.inverseCumulativeProbability(1.0 - significance / 2);
    return a * statistics.getStandardDeviation() / Math.sqrt(statistics.getN());
}
 
开发者ID:marcelovca90,项目名称:anti-spam-weka-gui,代码行数:7,代码来源:ExperimentHelper.java

示例5: getN

import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics; //导入方法依赖的package包/类
public int getN(final String feature) {
	final DescriptiveStatistics stat = stats.get(feature);
	return (int) ((stat == null ? 0 : stat.getN()) + getNull(feature));
}
 
开发者ID:ProfilingIO,项目名称:insight-ml,代码行数:5,代码来源:FeatureStatistics.java


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