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