def get_yvals(self, x): if self.cumulative: raise ValueError("dont' support getting y vals for cumulative") if self.isfunc: return self.pofx(x) else: rand = stat.interplin(self.xvals, self.pofx, x)
def _genrand_accum(self, numrand): # this returns f8 urand = self.rng.uniform(size=numrand) # to get randoms from the distribution, we interpolate the x(pcum) at # the test rand values. Clever! rand = stat.interplin(self.xvals, self.pcum, urand) return rand
def genrand_accum(self, numrand, seed=None): if seed is not None: numpy.random.seed(seed=seed) # this returns f8 urand = numpy.random.random(numrand) # to get randoms from the distribution, we interpolate the x(pcum) at # the test rand values. Clever! rand = stat.interplin(self.xvals, self.pcum, urand) return rand