func TestStddevBesselWeighted(t *testing.T) { result, err := mino.FromPoints(weightedFib).Transform(transform.Stddev{Bessel: true}) r := result.(transform.StddevResults) assert.Nil(t, err) assert.InEpsilon(t, 6.84670, r.Deviation, epsilon) assert.InEpsilon(t, 8.48138, r.Average, epsilon) }
func TestAverageWeighted(t *testing.T) { result, err := mino.FromPoints(weightedFib).Transform(transform.Average{}) assert.Nil(t, err) assert.InEpsilon(t, 8.4814, result.(float64), epsilon) }
func TestSumWeighted(t *testing.T) { result, err := mino.FromPoints(weightedFib).Transform(transform.Sum{}) assert.Nil(t, err) assert.InEpsilon(t, 114.5, result.(float64), epsilon) }