Esempio n. 1
0
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)
}
Esempio n. 2
0
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)
}
Esempio n. 3
0
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)
}