Example #1
0
 def random(a, t, b):
     u = ds.rg0()
     v = gamma.random(a, t)
     vv = gamma.random(a + 1, t)
     if (u <= (t / (b + t))):
         return v
     return vv
 def random(a, b, t, g, c):
     u = ds.rg0()
     v1 = gamma.random(a, t)
     v2 = gamma.random(a + 1, t)
     if (u <= t / (b + t)):
         return g * math.pow(v1, 1 / c)
     return g * math.pow(v2, 1 / c)
Example #3
0
 def random(t):
     u = ds.rg0()
     v = exponential.random(t)
     w = gamma.random(3, t)
     if (u <= t / (1 + t)):
         return v
     return w
Example #4
0
 def random(a,t):
     u=uniform.random(0,1)
     v=exponential.random(t)
     w=gamma.random(3,t)
     if(u<a/(1+a)):
         return v
     return w
Example #5
0
 def random(t):
     return gamma.random(t,4)
Example #6
0
 def random(aa, bb, mu, lmbda):
     n = gamma.random(aa, bb)
     return normal.random(mu, math.sqrt(1 / (lmbda * n)))
Example #7
0
 def random(z, l, a, g):
     return z + l * math.log(gamma.random(g, 1) / gamma.random(a, 1))
 def random(b, aa, bb):
     return max(exponential.random(b),
                b - gamma.random(aa, bb) * math.log(-math.log(r.random())))
Example #9
0
 def random(a, s, aa, gmma, bb):
     return a + s * math.pow(
         (gamma.random(aa, 1) / gamma.random(gmma, 1)), 1 / bb)
Example #10
0
 def random(a,b):
     return poisson.random(gamma.random(a,b))
Example #11
0
 def random(a, theta, aa, bb):
     return a + theta * math.pow(gamma.random(aa, 1), 1 / bb)
Example #12
0
 def random(a, K):
     yy = np.zeros(a.shape)
     for i in range(K):
         yy[i][0] = gamma.random(a[i][0], 1)
     yy /= np.sum(yy)
     return yy
Example #13
0
 def random(aa, bb):
     if (aa <= 0 or bb <= 0):
         raise ValueError("aa and bb must be greater than 0")
     return gamma.random(aa, 1) / gamma.random(bb, 1)
Example #14
0
 def random(a,b):
     return 1/gamma.random(a,b)
Example #15
0
 def random(a, b):
     c = gamma.random(b, 1)
     while (c == 0):
         c = gamma.random(b, 1)
     return gamma.random(a, 1) / c
Example #16
0
 def random(s,k):
     return gamma.random(2*(s**2),k/2.0)
Example #17
0
 def random(a,b):
     return math.exp(gamma.random(-1/b,a))
Example #18
0
 def random(a, b):
     return math.sqrt(exponential.random(1) * gamma.random(a, b / a))
Example #19
0
 def random(aa, bb):
     if (aa <= 0 or bb <= 0):
         raise ValueError("aa and bb must be bigger than 0")
     x = gamma.random(aa, 1)
     return x / (x + gamma.random(bb, 1))
Example #20
0
 def random(s, m):
     return normal.random(0, s) / math.sqrt(gamma.random(1 / 2, m - 1 / 2))
Example #21
0
 def random(mu, sigma, gmma, d1, d2):
     return mu + sigma * math.pow(
         gamma.random(d1, 1) / gamma.random(d2, 1), gmma)