本文整理汇总了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)));
}
}
示例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)));
}
}
示例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)));
}
}
示例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)));
}
}
示例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>>();
}
示例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;
}
示例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());
}
示例8: Statistic
import org.apache.commons.math3.stat.descriptive.UnivariateStatistic; //导入依赖的package包/类
Statistic(UnivariateStatistic statistic){
this.statistic = statistic;
}
示例9: getStatistic
import org.apache.commons.math3.stat.descriptive.UnivariateStatistic; //导入依赖的package包/类
protected UnivariateStatistic getStatistic(){
return statistic;
}
示例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();
}
示例11: getUnivariateStatistic
import org.apache.commons.math3.stat.descriptive.UnivariateStatistic; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public UnivariateStatistic getUnivariateStatistic() {
return new StandardDeviation();
}
示例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();
}
示例13: getUnivariateStatistic
import org.apache.commons.math3.stat.descriptive.UnivariateStatistic; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public UnivariateStatistic getUnivariateStatistic() {
return new Variance();
}
示例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();
}
示例15: getUnivariateStatistic
import org.apache.commons.math3.stat.descriptive.UnivariateStatistic; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public UnivariateStatistic getUnivariateStatistic() {
return new Skewness();
}