package h2;
import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics;
public class pro {
int s,number;
public static void main(String[] args) {
pro test=new pro();
}
pro(){
number=100;
DescriptiveStatistics sta = new DescriptiveStatistics();
DescriptiveStatistics sta2 = new DescriptiveStatistics();
for(s=1;s<number+1;s++){
sta.addValue(2*s);
}
for(s=1;s<number+1;s++){
sta2.addValue(s);
}
double mean = sta.getMean();
double std = sta.getStandardDeviation();
double mean2 = sta2.getMean();
double std2 = sta2.getStandardDeviation();
System.out.println(std2+","+std);
double alpha,beta;
alpha=std*std/(std*std+std2*std2);
beta=std2*std2/(std*std+std2*std2);
System.out.println(alpha+","+beta);
}
}
最終更新:2014年04月28日 02:56