1.Instance Constructors
new StatCounter() //初始化StatCounter()
new StatCounter(values:TraversableOnce[Double])
//用给定的值实例化StatCounter,TranversableOnce我觉得相当于是个迭代器,指针只能从前往后查看一遍(不能逆行)
2.Value Members
def copy():StatCounter
//Clone this StatCounter
def count:Long
def max:Double
def mean:Double
重点方法:merge()
def merge(other:StatCounter):StatCounter
//Merge another StatCounter into this one, adding up the internal statistics.
添加内部统计。
def merge(values:TraversableOnce[Double]):StatCounter
Add multiple values into this StatCounter, updating the internal statistics.
def merge(value:Double) :StatCounter
Add a value into this StatCounter, updating the internal statistics.
def min:Double
def sampleStdev:Double
//如果数据是从总体中取出来的样本,计算出的标准差就是样本标准差
Return the sample standard deviation of the values,
which corrects for bias in estimating the variance by dividing by N-1 instead of N.
def sampleVariance:Double
Return the sample variance, which corrects for bias in estimating the variance by dividing by N-1 insteading of N.
def stdev:Double
Return the standard deviation of the values.
def sum:Double
def toString():String
def variance:Double
Return the variance of the values.