Пример #1
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
Пример #2
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
Пример #3
0
 def random(lmbdas,probs):
     a=r.random()
     probs2=probs/sum(probs)
     counter=0
     while(a>sum(probs2[:counter+1])):
         counter+=1
     return exp.random(lmbdas[counter])
Пример #4
0
 def random(a, b):
     return math.sqrt(exponential.random(1) * gamma.random(a, b / a))
Пример #5
0
 def random(b,t):
     w=exponential.random(1/b)
     return 2*t/(1-t**2)*w+math.sqrt(2/(1-t**2))*math.sqrt(w)*normal.random(0,1)
 def random(b, aa, bb):
     return max(exponential.random(b),
                b - gamma.random(aa, bb) * math.log(-math.log(r.random())))
Пример #7
0
 def random(lmbdas):
     sum_ = 0
     for i in range(lmbdas):
         sum_ += exponential.random(lmbdas[i])
     return sum_
Пример #8
0
 def random(mu, sigma2, lmbda):
     return normal.random(mu, sigma2) + exponential.random(lmbda)