Exemplo n.º 1
0
 def test_generic_2(self):
     x = [1.0, 2.0, 2.0, 3.0, 3.0, 3.0, 4.0, 4.0, 5.0]
     mode = robustats.mode(x)
     self.assertEqual(mode, 3.0)
Exemplo n.º 2
0
 def test_homogeneous_sample(self):
     x = [1.0, 2.0, 3.0, 4.0, 5.0]
     mode = robustats.mode(x)
     self.assertEqual(mode, 2.0)
Exemplo n.º 3
0
 def test_gamma_1(self):
     # Gamma distribution with alpha = 11.0 and beta = 10.0 --> mode = 1.0
     x = [1.17, 0.82, 0.85, 2.1, 1.35, 1.21, 1.07, 0.81, 1.09, 1.27]
     mode = robustats.mode(x)
     self.assertEqual(mode, 1.08)
Exemplo n.º 4
0
 def test_gaussian_1(self):
     # Gaussian distribution with mu = 1.0 and sigma = 0.2 --> mode = 1.0
     x = [1.06, 1.25, 0.99, 1.07, 1.46, 1.02, 1.14, 1.04, 0.6, 1.0]
     mode = robustats.mode(x)
     self.assertEqual(mode, 0.995)
Exemplo n.º 5
0
 def test_generic_4(self):
     x = [1., 2., 3., 3., 3., 4., 4., 4., 4., 4., 5., 6., 7.]
     mode = robustats.mode(x)
     self.assertEqual(mode, 4.)
Exemplo n.º 6
0
 def test_homogeneous_sample(self):
     x = [1., 2., 3., 4., 5.]
     mode = robustats.mode(x)
     self.assertEqual(mode, 2.)