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