Example #1
0
 def test_FGSugenoLambda1(self):
     # http://www.diva-portal.org/smash/record.jsf?pid=diva2%3A833444&dswid=7043
     # http://www.diva-portal.org/smash/get/diva2:833444/FULLTEXT01.pdf
     mu = [0.93295, 0.303787, 0.18659]
     x = [0.3, 0.3, 0.8]
     r = FI.SugenoLambda(x, mu)
     e = FI.GeneralizedSugenoLambda(min, max, x, mu)
     self.assertAlmostEqual(r, e, places=3)
Example #2
0
 def test_GChoquetLambda(self):
     # C.G. Magadun an M.S. Bapat
     # SCILAB resolving 6th grade equation for lambda
     # http://www.researchmathsci.org/IJFMAart/IJFMA-v15n2-1.pdf
     mu = [0.8, 0.8, 0.5, 0.7, 0.5, 0.4]
     x = [48, 50, 35, 40, 43, 43]
     r = FI.ChoquetLambda(x, mu)
     e = FI.GeneralizedChoquetLambda(mul, sum, x, mu)
     self.assertAlmostEqual(r, e, places=4)
Example #3
0
 def test_FSugenoLambda3(self):
     # http://www.diva-portal.org/smash/record.jsf?pid=diva2%3A833444&dswid=7043
     # http://www.diva-portal.org/smash/get/diva2:833444/FULLTEXT01.pdf
     mu = [0.93295, 0.303787, 0.18659]
     x = [0.3, 0.3, 0.8]
     r = FI.SugenoLambda(x, mu)
     expected = 0.300
     self.assertAlmostEqual(r, expected, places=3)
Example #4
0
 def test_FChoquetLambda1(self):
     # http://www.diva-portal.org/smash/record.jsf?pid=diva2%3A833444&dswid=7043
     # http://www.diva-portal.org/smash/get/diva2:833444/FULLTEXT01.pdf
     mu = [0.45, 0.45, 0.3]
     x = [45, 50, 40]
     r = FI.ChoquetLambda(x, mu)
     expected = 46.295
     self.assertAlmostEqual(r, expected, places=3)
Example #5
0
 def test_ChoquetLambda4(self):
     # C.G. Magadun an M.S. Bapat
     # SCILAB resolving 6th grade equation for lambda
     # http://www.researchmathsci.org/IJFMAart/IJFMA-v15n2-1.pdf
     mu = [0.8, 0.8, 0.5, 0.7, 0.5, 0.4]
     x = [48, 50, 35, 40, 43, 43]
     r = FI.ChoquetLambda(x, mu)
     expected = 49.365525
     self.assertAlmostEqual(r, expected, places=4)
Example #6
0
 def test_FChoquetLambda2(self):
     # http://www.diva-portal.org/smash/record.jsf?pid=diva2%3A833444&dswid=7043
     # http://www.diva-portal.org/smash/get/diva2:833444/FULLTEXT01.pdf
     mu = [0.45, 0.45, 0.3]
     x = [39, 58, 55]
     r = FI.ChoquetLambda(x, mu)
     expected = 51.3804
     self.assertAlmostEqual(r, expected,
                            places=2)  # wiht 3 fails -> 51.3796
Example #7
0
 def test_ChoquetLambda5(self):
     # C.G. Magadun an M.S. Bapat
     # SCILAB resolving 6th grade equation for lambda
     # http://www.researchmathsci.org/IJFMAart/IJFMA-v15n2-1.pdf
     # FChoquet fails with this data. An error in the paper?
     # Hand made calculus seems right
     # 34*1+7*0.9957168+1*0.9896093+1*0.9774167+1*0.8805899+3*0.4
     mu = [0.8, 0.8, 0.5, 0.7, 0.5, 0.4]
     x = [43, 44, 41, 34, 42, 47]
     r = FI.ChoquetLambda(x, mu)
     expected = 45.917632
     self.assertAlmostEqual(r, expected, places=4)
Example #8
0
 def test_DF(self):
     mu = np.array([0.5, 0.4, 0.1])
     l = FI.DFlambda(0, mu)
     espl = 0
     self.assertAlmostEqual(l, espl, places=5)
Example #9
0
 def test_F(self):
     mu = np.array([0.5, 0.4, 0.1])
     l = FI.FLambda(0, mu)
     espl = 0
     self.assertEqual(l, espl)