[code]
x拨=(200+50+100+200)/4 = 550/4 = 137.5
S^2 = [(200-137.5)^2+(50-137.5)^2+(100-137.5)^2+(200-137.5)^2]/(4-1) =[62.5^2+(-87.5)^2+(-37.5)^2+62.5^2]/3 =[3906.25+7656.25+1406.25+3906.25]/3 = 16875/3 = 5625
标准偏差 S = Sqr(5625) = 75
[/code]
cv 变异系数(coefficient of variation),亦称离散系数(coefficient of dispersion)或相对偏差(rsd),是标准偏差与平均值之比,用百分数表示,计算公式为:
cv = sd/mean ×100%
200、50、100、200的cv=55%
通过[url=http://commons.apache.org/math/userguide/stat.html]commons-math[/url],要计算SD、CV值,只需要
[code]
// Get a DescriptiveStatistics instance using factory method
DescriptiveStatistics stats = DescriptiveStatistics.newInstance();
// Add the data from the array
for( int i = 0; i