class StatCounter extends Serializable
A class for tracking the statistics of a set of numbers (count, mean and variance) in a numerically robust way. Includes support for merging two StatCounters. Based on Welford and Chan's algorithms for running variance.
- Source
- StatCounter.scala
- Alphabetic
- By Inheritance
- StatCounter
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
Value Members
- def copy(): StatCounter
Clone this StatCounter
- def count: Long
- def max: Double
- def mean: Double
- def merge(other: StatCounter): StatCounter
Merge another StatCounter into this one, adding up the internal statistics.
- def merge(values: IterableOnce[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 popStdev: Double
Return the population standard deviation of the values.
Return the population standard deviation of the values.
- Annotations
- @Since("2.1.0")
- def popVariance: Double
Return the population variance of the values.
Return the population variance of the values.
- Annotations
- @Since("2.1.0")
- 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 instead of N.
- def stdev: Double
Return the population standard deviation of the values.
- def sum: Double
- def toString(): String
- Definition Classes
- StatCounter → AnyRef → Any
- def variance: Double
Return the population variance of the values.