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


Java UnivariateStatistic类代码示例

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


UnivariateStatistic类属于org.apache.commons.math3.stat.descriptive包,在下文中一共展示了UnivariateStatistic类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testAllTechniquesSingleton

import org.apache.commons.math3.stat.descriptive.UnivariateStatistic; //导入依赖的package包/类
@Test
public void testAllTechniquesSingleton() {
    double[] singletonArray = new double[] { 1d };
    for (EstimationType e : EstimationType.values()) {
        UnivariateStatistic percentile = getTestMedian(e);
        Assert.assertEquals(1d, percentile.evaluate(singletonArray), 0);
        Assert.assertEquals(1d, percentile.evaluate(singletonArray, 0, 1),
                0);
        Assert.assertEquals(1d,
                new Median().evaluate(singletonArray, 0, 1, 5), 0);
        Assert.assertEquals(1d,
                new Median().evaluate(singletonArray, 0, 1, 100), 0);
        Assert.assertTrue(Double.isNaN(percentile.evaluate(singletonArray,
                0, 0)));
    }
}
 
开发者ID:Quanticol,项目名称:CARMA,代码行数:17,代码来源:MedianTest.java

示例2: testAllTechniquesNullEmpty

import org.apache.commons.math3.stat.descriptive.UnivariateStatistic; //导入依赖的package包/类
@Test
public void testAllTechniquesNullEmpty() {

    final double[] nullArray = null;
    final double[] emptyArray = new double[] {};
    for (final Percentile.EstimationType e : Percentile.EstimationType.values()) {
        reset (50, e);
        final UnivariateStatistic percentile = getUnivariateStatistic();
        try {
            percentile.evaluate(nullArray);
            Assert.fail("Expecting MathIllegalArgumentException "
                    + "for null array");
        } catch (final MathIllegalArgumentException ex) {
            // expected
        }
        Assert.assertTrue(Double.isNaN(percentile.evaluate(emptyArray)));
    }

}
 
开发者ID:Quanticol,项目名称:CARMA,代码行数:20,代码来源:PercentileTest.java

示例3: testAllTechniquesSingleton

import org.apache.commons.math3.stat.descriptive.UnivariateStatistic; //导入依赖的package包/类
@Test
public void testAllTechniquesSingleton() {
    final double[] singletonArray = new double[] { 1d };
    for (final Percentile.EstimationType e : Percentile.EstimationType.values()) {
        reset (50, e);
        final UnivariateStatistic percentile = getUnivariateStatistic();
        Assert.assertEquals(1d, percentile.evaluate(singletonArray), 0);
        Assert.assertEquals(1d, percentile.evaluate(singletonArray, 0, 1),
                0);
        Assert.assertEquals(1d,
                new Percentile().evaluate(singletonArray, 0, 1, 5), 0);
        Assert.assertEquals(1d,
                new Percentile().evaluate(singletonArray, 0, 1, 100), 0);
        Assert.assertTrue(Double.isNaN(percentile.evaluate(singletonArray,
                0, 0)));
    }
}
 
开发者ID:Quanticol,项目名称:CARMA,代码行数:18,代码来源:PercentileTest.java

示例4: testAllTechniquesEmpty

import org.apache.commons.math3.stat.descriptive.UnivariateStatistic; //导入依赖的package包/类
@Test
public void testAllTechniquesEmpty() {
    final double[] singletonArray = new double[] { };
    for (final Percentile.EstimationType e : Percentile.EstimationType.values()) {
        reset (50, e);
        final UnivariateStatistic percentile = getUnivariateStatistic();
        Assert.assertEquals(Double.NaN, percentile.evaluate(singletonArray),
                0);
        Assert.assertEquals(Double.NaN, percentile.evaluate(singletonArray,
                0, 0),
                0);
        Assert.assertEquals(Double.NaN,
                new Percentile().evaluate(singletonArray, 0, 0, 5), 0);
        Assert.assertEquals(Double.NaN,
                new Percentile().evaluate(singletonArray, 0, 0, 100), 0);
        Assert.assertTrue(Double.isNaN(percentile.evaluate(singletonArray,
                0, 0)));
    }
}
 
开发者ID:Quanticol,项目名称:CARMA,代码行数:20,代码来源:PercentileTest.java

示例5: Analyzer

import org.apache.commons.math3.stat.descriptive.UnivariateStatistic; //导入依赖的package包/类
/**
 * Constructs a new analyzer initialized with default settings.
 */
public Analyzer() {
	super();
	
	significanceLevel = 0.05;
	statistics = new ArrayList<UnivariateStatistic>();
	data = new HashMap<String, List<NondominatedPopulation>>();
}
 
开发者ID:Matsemann,项目名称:eamaster,代码行数:11,代码来源:Analyzer.java

示例6: apply

import org.apache.commons.math3.stat.descriptive.UnivariateStatistic; //导入依赖的package包/类
/**
 * Apply the given statistic to this univariate collection.
 * @param stat the statistic to apply
 * @return the computed value of the statistic.
 */
@Override
public double apply(UnivariateStatistic stat) {
    double[] v = this.getValues();

    if (v != null) {
        return stat.evaluate(v, 0, v.length);
    }
    return Double.NaN;
}
 
开发者ID:Quanticol,项目名称:CARMA,代码行数:15,代码来源:ListUnivariateImpl.java

示例7: testAllTechniques5

import org.apache.commons.math3.stat.descriptive.UnivariateStatistic; //导入依赖的package包/类
@Test
public void testAllTechniques5() {
    reset(5, Percentile.EstimationType.LEGACY);
    final UnivariateStatistic percentile = getUnivariateStatistic();
    Assert.assertEquals(this.percentile5, percentile.evaluate(testArray),
            getTolerance());
    testAssertMappedValues(testArray,
            new Object[][] { { Percentile.EstimationType.LEGACY, percentile5 }, { Percentile.EstimationType.R_1, 8.8000 },
                    { Percentile.EstimationType.R_2, 8.8000 }, { Percentile.EstimationType.R_3, 8.2000 }, { Percentile.EstimationType.R_4, 8.2600 },
                    { Percentile.EstimationType.R_5, 8.5600 }, { Percentile.EstimationType.R_6, 8.2900 },
                    { Percentile.EstimationType.R_7, 8.8100 }, { Percentile.EstimationType.R_8, 8.4700 },
                    { Percentile.EstimationType.R_9, 8.4925 }}, 5d, getTolerance());
}
 
开发者ID:Quanticol,项目名称:CARMA,代码行数:14,代码来源:PercentileTest.java

示例8: Statistic

import org.apache.commons.math3.stat.descriptive.UnivariateStatistic; //导入依赖的package包/类
Statistic(UnivariateStatistic statistic){
    this.statistic = statistic;
}
 
开发者ID:FutureCitiesCatapult,项目名称:TomboloDigitalConnector,代码行数:4,代码来源:DescriptiveStatisticsField.java

示例9: getStatistic

import org.apache.commons.math3.stat.descriptive.UnivariateStatistic; //导入依赖的package包/类
protected UnivariateStatistic getStatistic(){
    return statistic;
}
 
开发者ID:FutureCitiesCatapult,项目名称:TomboloDigitalConnector,代码行数:4,代码来源:DescriptiveStatisticsField.java

示例10: getUnivariateStatistic

import org.apache.commons.math3.stat.descriptive.UnivariateStatistic; //导入依赖的package包/类
/**
 * @see org.apache.commons.math3.stat.descriptive.UnivariateStatisticAbstractTest#getUnivariateStatistic()
 */
@Override
public UnivariateStatistic getUnivariateStatistic() {
    return new FirstMoment();
}
 
开发者ID:Quanticol,项目名称:CARMA,代码行数:8,代码来源:FirstMomentTest.java

示例11: getUnivariateStatistic

import org.apache.commons.math3.stat.descriptive.UnivariateStatistic; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public UnivariateStatistic getUnivariateStatistic() {
    return new StandardDeviation();
}
 
开发者ID:Quanticol,项目名称:CARMA,代码行数:8,代码来源:StandardDeviationTest.java

示例12: getUnivariateStatistic

import org.apache.commons.math3.stat.descriptive.UnivariateStatistic; //导入依赖的package包/类
/**
 * @see org.apache.commons.math3.stat.descriptive.UnivariateStatisticAbstractTest#getUnivariateStatistic()
 */
@Override
public UnivariateStatistic getUnivariateStatistic() {
    return new SecondMoment();
}
 
开发者ID:Quanticol,项目名称:CARMA,代码行数:8,代码来源:SecondMomentTest.java

示例13: getUnivariateStatistic

import org.apache.commons.math3.stat.descriptive.UnivariateStatistic; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public UnivariateStatistic getUnivariateStatistic() {
    return new Variance();
}
 
开发者ID:Quanticol,项目名称:CARMA,代码行数:8,代码来源:VarianceTest.java

示例14: getUnivariateStatistic

import org.apache.commons.math3.stat.descriptive.UnivariateStatistic; //导入依赖的package包/类
/**
 * @see org.apache.commons.math3.stat.descriptive.UnivariateStatisticAbstractTest#getUnivariateStatistic()
 */
@Override
public UnivariateStatistic getUnivariateStatistic() {
    return new FourthMoment();
}
 
开发者ID:Quanticol,项目名称:CARMA,代码行数:8,代码来源:FourthMomentTest.java

示例15: getUnivariateStatistic

import org.apache.commons.math3.stat.descriptive.UnivariateStatistic; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public UnivariateStatistic getUnivariateStatistic() {
    return new Skewness();
}
 
开发者ID:Quanticol,项目名称:CARMA,代码行数:8,代码来源:SkewnessTest.java


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