• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Statistics类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: createDataset

import org.jfree.data.statistics.Statistics; //导入依赖的package包/类
/**
   * Creates a sample dataset.
   * 
   * @return The dataset.
   */
  protected CategoryDataset createDataset(boolean isDemo) {
double mean, stdDev;

if (isDemo){
SERIES_COUNT = 3;
    //  CATEGORY_COUNT = 1;
      VALUE_COUNT = 10;
values_storage = new String[SERIES_COUNT][CATEGORY_COUNT];
 

      DefaultStatisticalCategoryDataset dataset 
          = new DefaultStatisticalCategoryDataset();

      for (int s = 0; s < SERIES_COUNT; s++) {
          for (int c = 0; c < CATEGORY_COUNT; c++) {
              Double[] values = createValueList(0, 20.0, VALUE_COUNT);
		values_storage[s][c]= vs;
		mean = Statistics.calculateMean(values);
		stdDev = Statistics.getStdDev(values);
              dataset.add(mean,stdDev, "Series " + s, "Category " + c);
          }
      }
      return dataset;}
else return super.createDataset(false);
  }
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:31,代码来源:StatisticalBarChartDemo3.java


示例2: createDataset

import org.jfree.data.statistics.Statistics; //导入依赖的package包/类
/**
   * Creates a sample dataset.
   * 
   * @return The dataset.
   */
  protected CategoryDataset createDataset(boolean isDemo) {
double mean, stdDev;

if (isDemo){
SERIES_COUNT = 3;
      CATEGORY_COUNT = 2;
      VALUE_COUNT = 10;
values_storage = new String[SERIES_COUNT][CATEGORY_COUNT];
 

      DefaultStatisticalCategoryDataset dataset 
          = new DefaultStatisticalCategoryDataset();

      for (int s = 0; s < SERIES_COUNT; s++) {
          for (int c = 0; c < CATEGORY_COUNT; c++) {
              Double[] values = createValueList(0, 20.0, VALUE_COUNT);
		values_storage[s][c]= vs;
		mean = Statistics.calculateMean(values);
		stdDev = Statistics.getStdDev(values);
              dataset.add(mean,stdDev, "Series " + s, "Category " + c);
          }
      }
      return dataset;}
else return super.createDataset(false);
  }
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:31,代码来源:StatisticalBarChartDemo2.java


示例3: paramEstimate

import org.jfree.data.statistics.Statistics; //导入依赖的package包/类
public void paramEstimate(double[] distData) {
 	double a, b, sum = 0;

 	//a = getMedian();
 	List<Double> valueList = new java.util.ArrayList<Double>();
 	for (int i=0; i<distData.length; i++){
valueList.add(new Double(distData[i]));
 	}
 	a = Statistics.calculateMedian(valueList);
 	
 	sum = 0;
 	for(int i = 0; i < distData.length; i++){
 		double temp = Math.abs(distData[i]-a); 
 		sum += temp;
 	}
 	b = sum/distData.length;
 	setParameters(a, b);
 }
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:19,代码来源:LaplaceDistribution.java


示例4: testCalculateMean1

import org.jfree.data.statistics.Statistics; //导入依赖的package包/类
/**
 * A simple test for the calculateMean(Collection) method.
 */
public void testCalculateMean1() {
    List values = new ArrayList();
    values.add(new Double(9.0));
    values.add(new Double(3.0));
    values.add(new Double(2.0));
    values.add(new Double(2.0));
    double mean = Statistics.calculateMean(values);
    assertEquals(4.0, mean, 0.0000001);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:13,代码来源:StatisticsTests.java


示例5: testCalculateMean2

import org.jfree.data.statistics.Statistics; //导入依赖的package包/类
/**
 * A simple test for the calculateMean(Number[]) method.
 */
public void testCalculateMean2() {
    final Number[] values = new Number[3];
    values[0] = new Double(1);
    values[1] = new Double(2);
    values[2] = new Double(3);
    final double mean = Statistics.calculateMean(values);
    assertEquals(2.0, mean, 0.0000001);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:12,代码来源:StatisticsTests.java


示例6: testCalculateMedian1

import org.jfree.data.statistics.Statistics; //导入依赖的package包/类
/**
 * A test for the calculateMedian() method.
 */
public void testCalculateMedian1() {
    final List values = new ArrayList();
    values.add(new Double(1.0));
    final double median = Statistics.calculateMedian(values);
    assertEquals(1.0, median, 0.0000001);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:10,代码来源:StatisticsTests.java


示例7: testCalculateMedian2

import org.jfree.data.statistics.Statistics; //导入依赖的package包/类
/**
 * A test for the calculateMedian() method.
 */
public void testCalculateMedian2() {
    final List values = new ArrayList();
    values.add(new Double(2.0));
    values.add(new Double(1.0));
    final double median = Statistics.calculateMedian(values);
    assertEquals(1.5, median, 0.0000001);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:11,代码来源:StatisticsTests.java


示例8: testCalculateMedian3

import org.jfree.data.statistics.Statistics; //导入依赖的package包/类
/**
 * A test for the calculateMedian() method.
 */
public void testCalculateMedian3() {
    final List values = new ArrayList();
    values.add(new Double(1.0));
    values.add(new Double(2.0));
    values.add(new Double(3.0));
    values.add(new Double(6.0));
    values.add(new Double(5.0));
    values.add(new Double(4.0));
    final double median = Statistics.calculateMedian(values);
    assertEquals(3.5, median, 0.0000001);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:15,代码来源:StatisticsTests.java


示例9: testCalculateMedian4

import org.jfree.data.statistics.Statistics; //导入依赖的package包/类
/**
 * A test for the calculateMedian() method.
 */
public void testCalculateMedian4() {
    final List values = new ArrayList();
    values.add(new Double(7.0));
    values.add(new Double(2.0));
    values.add(new Double(3.0));
    values.add(new Double(5.0));
    values.add(new Double(4.0));
    values.add(new Double(6.0));
    values.add(new Double(1.0));
    final double median = Statistics.calculateMedian(values);
    assertEquals(4.0, median, 0.0000001);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:16,代码来源:StatisticsTests.java


示例10: testCalculateMedian6

import org.jfree.data.statistics.Statistics; //导入依赖的package包/类
/**
 * A test for the calculateMedian() method.
 */
public void testCalculateMedian6() {
    final List values = new ArrayList();
    values.add(new Double(7.0));
    values.add(new Double(2.0));
    values.add(new Double(3.0));
    values.add(new Double(5.0));
    values.add(new Double(4.0));
    values.add(new Double(6.0));
    values.add(new Double(1.0));
    final double median = Statistics.calculateMedian(values, 0, 2);
    assertEquals(3.0, median, 0.0000001);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:16,代码来源:StatisticsTests.java


示例11: testCorrelation1

import org.jfree.data.statistics.Statistics; //导入依赖的package包/类
/**
 * A simple test for the correlation calculation.
 */
public void testCorrelation1() {
    final Number[] data1 = new Number[3];
    data1[0] = new Double(1);
    data1[1] = new Double(2);
    data1[2] = new Double(3);        
    final Number[] data2 = new Number[3];
    data2[0] = new Double(1);
    data2[1] = new Double(2);
    data2[2] = new Double(3);    
    final double r = Statistics.getCorrelation(data1, data2);
    assertTrue(NumberUtils.equal(r, 1.0));        
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:16,代码来源:StatisticsTests.java


示例12: testCalculateMedian1

import org.jfree.data.statistics.Statistics; //导入依赖的package包/类
/**
 * A test for the calculateMedian() method.
 */
public void testCalculateMedian1() {
    List values = new ArrayList();
    values.add(new Double(1.0));
    double median = Statistics.calculateMedian(values);
    assertEquals(1.0, median, 0.0000001);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:10,代码来源:StatisticsTests.java


示例13: testCalculateMedian2

import org.jfree.data.statistics.Statistics; //导入依赖的package包/类
/**
 * A test for the calculateMedian() method.
 */
public void testCalculateMedian2() {
    List values = new ArrayList();
    values.add(new Double(2.0));
    values.add(new Double(1.0));
    double median = Statistics.calculateMedian(values);
    assertEquals(1.5, median, 0.0000001);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:11,代码来源:StatisticsTests.java


示例14: testCalculateMedian3

import org.jfree.data.statistics.Statistics; //导入依赖的package包/类
/**
 * A test for the calculateMedian() method.
 */
public void testCalculateMedian3() {
    List values = new ArrayList();
    values.add(new Double(1.0));
    values.add(new Double(2.0));
    values.add(new Double(3.0));
    values.add(new Double(6.0));
    values.add(new Double(5.0));
    values.add(new Double(4.0));
    double median = Statistics.calculateMedian(values);
    assertEquals(3.5, median, 0.0000001);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:15,代码来源:StatisticsTests.java


示例15: testCalculateMedian4

import org.jfree.data.statistics.Statistics; //导入依赖的package包/类
/**
 * A test for the calculateMedian() method.
 */
public void testCalculateMedian4() {
    List values = new ArrayList();
    values.add(new Double(7.0));
    values.add(new Double(2.0));
    values.add(new Double(3.0));
    values.add(new Double(5.0));
    values.add(new Double(4.0));
    values.add(new Double(6.0));
    values.add(new Double(1.0));
    double median = Statistics.calculateMedian(values);
    assertEquals(4.0, median, 0.0000001);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:16,代码来源:StatisticsTests.java


示例16: testCalculateMedian6

import org.jfree.data.statistics.Statistics; //导入依赖的package包/类
/**
 * A test for the calculateMedian() method.
 */
public void testCalculateMedian6() {
    List values = new ArrayList();
    values.add(new Double(7.0));
    values.add(new Double(2.0));
    values.add(new Double(3.0));
    values.add(new Double(5.0));
    values.add(new Double(4.0));
    values.add(new Double(6.0));
    values.add(new Double(1.0));
    double median = Statistics.calculateMedian(values, 0, 2);
    assertEquals(3.0, median, 0.0000001);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:16,代码来源:StatisticsTests.java


示例17: testCorrelation1

import org.jfree.data.statistics.Statistics; //导入依赖的package包/类
/**
 * A simple test for the correlation calculation.
 */
public void testCorrelation1() {
    Number[] data1 = new Number[3];
    data1[0] = new Double(1);
    data1[1] = new Double(2);
    data1[2] = new Double(3);        
    Number[] data2 = new Number[3];
    data2[0] = new Double(1);
    data2[1] = new Double(2);
    data2[2] = new Double(3);    
    double r = Statistics.getCorrelation(data1, data2);
    assertEquals(1.0, r, 0.00000001);        
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:16,代码来源:StatisticsTests.java


示例18: createDataset

import org.jfree.data.statistics.Statistics; //导入依赖的package包/类
/**
   * Creates a sample dataset.
   * 
   * @return The dataset.
   */
  protected CategoryDataset createDataset(boolean isDemo) {
double mean, stdDev;
      if (isDemo){
SERIES_COUNT = 2;
      CATEGORY_COUNT = 4;
      VALUE_COUNT = 10;
values_storage = new String[SERIES_COUNT][CATEGORY_COUNT];
 

      DefaultStatisticalCategoryDataset dataset 
          = new DefaultStatisticalCategoryDataset();

      for (int s = 0; s < SERIES_COUNT; s++) {
          for (int c = 0; c < CATEGORY_COUNT; c++) {
              Double[] values = createValueList(0, 20.0, VALUE_COUNT);
		values_storage[s][c]= vs;
		mean = Statistics.calculateMean(values);
		stdDev = Statistics.getStdDev(values);
              dataset.add(mean,stdDev, "Series " + s, "Category " + c);
          }
      }
  
      return dataset;}
else return super.createDataset(false);
              
  }
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:32,代码来源:StatisticalLineChartDemo2.java


示例19: createDataset

import org.jfree.data.statistics.Statistics; //导入依赖的package包/类
/**
   * Creates a sample dataset.
   * 
   * @return The dataset.
   */
  protected CategoryDataset createDataset(boolean isDemo) {
double mean, stdDev;
      if (isDemo){
SERIES_COUNT = 2;
   //   CATEGORY_COUNT = 4;
      VALUE_COUNT = 10;
values_storage = new String[SERIES_COUNT][CATEGORY_COUNT];
 

      DefaultStatisticalCategoryDataset dataset 
          = new DefaultStatisticalCategoryDataset();

      for (int s = 0; s < SERIES_COUNT; s++) {
          for (int c = 0; c < CATEGORY_COUNT; c++) {
              Double[] values = createValueList(0, 20.0, VALUE_COUNT);
		values_storage[s][c]= vs;
		mean = Statistics.calculateMean(values);
		stdDev = Statistics.getStdDev(values);
              dataset.add(mean,stdDev, "Series " + s, "Category " + c);
          }
      }
  
      return dataset;}
else return super.createDataset(false);
              
  }
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:32,代码来源:StatisticalLineChartDemo3.java


示例20: Summary

import org.jfree.data.statistics.Statistics; //导入依赖的package包/类
/**
 * calculate the statistical summary for the given dataset
 * @param dataset
 */
public Summary(PieDataset dataset){

	seriesCount = dataset.getItemCount();
	categoryCount = 1;
	
	cat_sampleSize = new int[categoryCount];
	cat_mean = new double[categoryCount];
	cat_median = new double[categoryCount];
	cat_stdDev = new double[categoryCount];
	cat_skew = new double[categoryCount];
	cat_kurt = new double[categoryCount];

	seriesName = new String[seriesCount];
	categoryName = new String[categoryCount];

	categoryName[0] = "Value";
	Double[] values = new Double[seriesCount];
	List<Double> valueList = new java.util.ArrayList<Double>();
	for (int i=0; i<seriesCount; i++){

		double v;
		if (dataset.getValue(i)!=null)
			v= dataset.getValue(i).doubleValue();	
		else v=0.0;
		values[i]=new Double(v);
		valueList.add(new Double(v));
	}
	
	cat_sampleSize[0]=valueList.size();
	cat_mean[0] = Statistics.calculateMean(values, false);
	cat_median[0] = Statistics.calculateMedian(valueList);
	cat_stdDev[0] = Statistics.getStdDev(values);
	cat_skew[0] = Statistics.calculateSkewness(values);
	cat_kurt[0] = Statistics.calculateKurtosis(values);

	return;
}
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:42,代码来源:Summary.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SOAPSEIModel类代码示例发布时间:2022-05-23
下一篇:
Java PaintException类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap