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


Java StatUtils.variance方法代码示例

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


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

示例1: testVarianceDecompMeanCutoff

import org.apache.commons.math.stat.StatUtils; //导入方法依赖的package包/类
/**
 * Check that the lower + upper semivariance against the mean sum to the
 * variance.
 */
public void testVarianceDecompMeanCutoff() {
    double[] values = { -2.0d, 2.0d, 4.0d, -2.0d, 22.0d, 11.0d, 3.0d, 14.0d, 5.0d };
    double variance = StatUtils.variance(values);
    SemiVariance sv = new SemiVariance(true); // Bias corrected
    sv.setVarianceDirection(SemiVariance.DOWNSIDE_VARIANCE);
    final double lower = sv.evaluate(values);
    sv.setVarianceDirection(SemiVariance.UPSIDE_VARIANCE);
    final double upper = sv.evaluate(values);
    assertEquals(variance, lower + upper, 10e-12);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:15,代码来源:SemiVarianceTest.java

示例2: testVarianceDecompMeanCutoff

import org.apache.commons.math.stat.StatUtils; //导入方法依赖的package包/类
/**
 * Check that the lower + upper semivariance against the mean sum to the
 * variance.
 */
@Test
public void testVarianceDecompMeanCutoff() {
    double[] values = { -2.0d, 2.0d, 4.0d, -2.0d, 22.0d, 11.0d, 3.0d, 14.0d, 5.0d };
    double variance = StatUtils.variance(values);
    SemiVariance sv = new SemiVariance(true); // Bias corrected
    sv.setVarianceDirection(SemiVariance.DOWNSIDE_VARIANCE);
    final double lower = sv.evaluate(values);
    sv.setVarianceDirection(SemiVariance.UPSIDE_VARIANCE);
    final double upper = sv.evaluate(values);
    Assert.assertEquals(variance, lower + upper, 10e-12);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:16,代码来源:SemiVarianceTest.java

示例3: getVariance

import org.apache.commons.math.stat.StatUtils; //导入方法依赖的package包/类
/**
 *
 * @param list
 * @return
 */
public double getVariance(List<SynsetOut> list) {
    double[] scores = new double[list.size()];
    int l = 0;
    for (SynsetOut out : list) {
        scores[l] = out.getScore();
        l++;
    }
    return StatUtils.variance(scores);
}
 
开发者ID:pippokill,项目名称:lesk-wsd-dsm,代码行数:15,代码来源:RevisedLesk.java

示例4: extractVariance

import org.apache.commons.math.stat.StatUtils; //导入方法依赖的package包/类
/**
 * Return the variance of the content of the points in the set.
 * @param <T> Type of ITrainingPoint to split.
 * @param set set to compute the variance from.
 * @return the variance of the content of the points in the set.
 */
protected <T extends ITrainingPoint<R, C>> double extractVariance(Collection<T> set)
{		
	double[] values = new double[set.size()];
	int i = 0;
	for (T element : set)
	{
		C number = element.getContent();
		values[i] = number.doubleValue();
		i++;
	}
	return StatUtils.variance(values);
}
 
开发者ID:williamleif,项目名称:PSRToolbox,代码行数:19,代码来源:RelativeVarianceReduction.java


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