Exemplo n.º 1
0
    def test_sampling(self):
        # FIXME: bogotest, extend tests!
        dist = PDist.lognorm(0.25)
        sampler = BoundRejectionSampler(dist, 0.5, 2)

        x = sampler.sample(10000)
        self.assertGreater(x.min(), 0.5)
        self.assertLess(x.max(), 2)
Exemplo n.º 2
0
 def __init__(self, execution_times: Dict[Tuple[str, str],
                                          Tuple[float, float, PDist]]):
     self.execution_times = execution_times
     self.execution_time_samplers = {
         k: BoundRejectionSampler(BufferedSampler(dist), xmin, xmax)
         for k, (xmin, xmax, dist) in execution_times.items()
     }
Exemplo n.º 3
0
 def __init__(self) -> None:
     super().__init__()
     self.execution_time_samplers = {
         k: BoundRejectionSampler(BufferedSampler(dist), xmin, xmax)
         for k, (xmin, xmax, dist) in execution_time_distributions.items()
     }