示例#1
0
    def test_library_random_variables(self):

        # Uniform distribution
        result_1 = rvh.get_uniform_sample(0, 1, 10)

        # Bernoulli distribution
        result_2 = rvh.get_bernoulli_sample(0.8)

        result_3 = rvh.get_bernoulli_sample(p=0.5, size=10)

        a = 5
示例#2
0
    def __init__(self, mean, size=10**7):
        self._mean = mean

        # Create a tape of values to return.
        self._tape = rvh.get_bernoulli_sample(p=self._mean, size=size)
        self._tape_index = 0