Exemplo n.º 1
0
    def testPareto(self, b, dtype):
        key = random.PRNGKey(0)
        rand = lambda key, b: random.pareto(key, b, (10000, ), dtype)
        crand = api.jit(rand)

        uncompiled_samples = rand(key, b)
        compiled_samples = crand(key, b)

        for samples in [uncompiled_samples, compiled_samples]:
            self._CheckKolmogorovSmirnovCDF(samples, scipy.stats.pareto(b).cdf)
Exemplo n.º 2
0
 def testParetoShape(self):
     key = random.PRNGKey(0)
     x = random.pareto(key, onp.array([0.2, 0.3]), shape=(3, 2))
     assert x.shape == (3, 2)
Exemplo n.º 3
0
def pareto(a, size=None):
    return JaxArray(
        jr.pareto(DEFAULT.split_key(), b=a, shape=_size2shape(size)))
Exemplo n.º 4
0
 def _rvs(self, b):
     return random.pareto(self._random_state, b, shape=self._size)
Exemplo n.º 5
0
 def pareto(self, a, size=None):
     return JaxArray(
         jr.pareto(self.split_key(), b=a, shape=_size2shape(size)))