Mean returns the arithmetic mean of all observations, or 0 if none.
()
| 79 | |
| 80 | // Mean returns the arithmetic mean of all observations, or 0 if none. |
| 81 | func (s *StatVar) Mean() float64 { |
| 82 | if s.count == 0 { |
| 83 | return 0 |
| 84 | } |
| 85 | return s.mean |
| 86 | } |
| 87 | |
| 88 | // SampleVariance returns the sample variance with Bessel's correction (divides |
| 89 | // by N−1), giving an unbiased estimator when the observations are a random |
no outgoing calls