コード例 #1
0
 def testExponential(self):
     for value in self.values:
         for parameter in self.params:
             expected = value -  parameter
             obtained = virtualValuation(value, exponential(scale=parameter)) 
             self.assertAlmostEqual(expected, obtained, msg="Given value " + str(value) + " and exponential distribution with parameter " + str(parameter) + ". Expected " + str(expected) + " but obtained  " + str(obtained) )
コード例 #2
0
 def testUniform(self):
     for value in self.values:
         expected = 2 * value -  1
         obtained = virtualValuation(value, uniform)
         self.assertAlmostEqual(expected, obtained, msg="Given value " + str(value) + " and distribution " + str(uniform) + ". Expected " + str(expected) + " but obtained  " + str(obtained) )