Exemplo n.º 1
0
func ExampleNewStrider() {
	data := stat.Float64Slice{
		.0421, .0941, .1064, .0242,
		.1331, .0773, .0243, .0815,
		.1186, .0356, .0728, .0999,
		.0614, .0479}
	strider := stat.NewStrider(data, 4)
	fmt.Printf("mean data is %.4f\n", stat.Mean(data))
	fmt.Printf("mean strider is %.4f\n", stat.Mean(strider))
	// Output:
	// mean data is 0.0728
	// mean strider is 0.0979
}
Exemplo n.º 2
0
func ExampleMean() {
	data := stat.Float64Slice{17.2, 18.1, 16.5, 18.3, 12.6}
	mean := stat.Mean(data)
	fmt.Printf("The sample mean is %g", mean)
	// Output: The sample mean is 16.54
}