|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
最初被命名为Oak,目标设定在家用电器等小型系统的编程语言,来解决诸如电视机、电话、闹钟、烤面包机等家用电器的控制和通讯问题。
apache的math组件,只管不经常使用,我明天也收拾出来。
下载地点:http://commons.apache.org/math/
示例代码:
packagedemo;
importorg.apache.commons.math.stat.descriptive.moment.GeometricMean;
importorg.apache.commons.math.stat.descriptive.moment.Kurtosis;
importorg.apache.commons.math.stat.descriptive.moment.Mean;
importorg.apache.commons.math.stat.descriptive.moment.Skewness;
importorg.apache.commons.math.stat.descriptive.moment.StandardDeviation;
importorg.apache.commons.math.stat.descriptive.moment.Variance;
importorg.apache.commons.math.stat.descriptive.rank.Max;
importorg.apache.commons.math.stat.descriptive.rank.Min;
importorg.apache.commons.math.stat.descriptive.rank.Percentile;
importorg.apache.commons.math.stat.descriptive.summary.Product;
importorg.apache.commons.math.stat.descriptive.summary.Sum;
importorg.apache.commons.math.stat.descriptive.summary.SumOfSquares;
publicclassTestMathUserage...{
publicstaticvoidmain(String[]args)...{
double[]values=newdouble[]...{0.33,1.33,0.27333,0.3,0.501,
0.444,0.44,0.34496,0.33,0.3,0.292,0.667};
/**//*
*System.out.println("min:"+StatUtils.min(values));
*System.out.println("max:"+StatUtils.max(values));
*System.out.println("mean:"+StatUtils.mean(values));//Returns
*thearithmeticmeanoftheentriesintheinputarray,orDouble.NaN
*ifthearrayisemptySystem.out.println("product:"+
*StatUtils.product(values));//Returnstheproductoftheentries
*intheinputarray,orDouble.NaNifthearrayisempty.
*System.out.println("sum:"+StatUtils.sum(values));//Returns
*thesumofthevaluesintheinputarray,orDouble.NaNifthearray
*isempty.System.out.println("variance:"+StatUtils.variance(
*values));//Returnsthevarianceoftheentriesintheinput
*array,orDouble.NaNifthearrayisempty.
*/
Minmin=newMin();
Maxmax=newMax();
Meanmean=newMean();//算术均匀值
Productproduct=newProduct();
Sumsum=newSum();
Variancevariance=newVariance();
System.out.println("min:"+min.evaluate(values));
System.out.println("max:"+max.evaluate(values));
System.out.println("mean:"+mean.evaluate(values));
System.out.println("product:"+product.evaluate(values));
System.out.println("sum:"+sum.evaluate(values));
System.out.println("variance:"+variance.evaluate(values));
Percentilepercentile=newPercentile();//百分位数
GeometricMeangeoMean=newGeometricMean();//多少均匀数,n个负数的连乘积的n次算术根叫做这n个数的多少均匀数
Skewnessskewness=newSkewness();//Skewness();
Kurtosiskurtosis=newKurtosis();//Kurtosis,峰度
SumOfSquaressumOfSquares=newSumOfSquares();//平方和
StandardDeviationStandardDeviation=newStandardDeviation();
System.out.println("80percentilevalue:"
+percentile.evaluate(values,80.0));
System.out.println("geometricmean:"+geoMean.evaluate(values));
System.out.println("skewness:"+skewness.evaluate(values));
System.out.println("kurtosis:"+kurtosis.evaluate(values));
System.out.println("sumOfSquares:"+sumOfSquares.evaluate(values));
//就是尺度方差
System.out.println("StandardDeviation:"
+StandardDeviation.evaluate(values));
}
}
<p>
还有就是总有人问我到底该学习什么语言,什么语言有前途,那么我的回答是不论是C,C++,java,.net网页编程,ruby,asp或是其他语言都可以学,编程的关键不是语言,而是思想。 |
|