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)
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)
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)
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
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)