Open LopatkinEvgeniy opened 3 years ago
There is a code:
func (s *ExpDecaySample) update(t time.Time, v int64) { // ... s.values.Push(expDecaySample{ k: math.Exp(t.Sub(s.t0).Seconds()*s.alpha) / rand.Float64(), v: v, }) // ... {
If rand.Float64() will return zero then the "k" value will be Inf. So this value will never be dropped (until rescale). This will increase the error of the results. Maybe division by random number is not a good idea?
rand.Float64()
There is a code:
If
rand.Float64()
will return zero then the "k" value will be Inf. So this value will never be dropped (until rescale). This will increase the error of the results. Maybe division by random number is not a good idea?