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 ExampleStrider() {
	data := stat.Float64Slice{
		.0421, .0941, .1064, .0242,
		.1331, .0773, .0243, .0815,
		.1186, .0356, .0728, .0999,
		.0614, .0479}
	strider := stat.NewStrider(data, 4)
	for i := 0; i < strider.Len(); i++ {
		fmt.Println(strider.Get(i))
	}
	// Output:
	// 0.0421
	// 0.1331
	// 0.1186
}