Esempio n. 1
0
 def stddev(mu,sigma,xi):
     if(xi==0):
         return extremevalue.random(mu,sigma)
     if(sigma<=0):
         raise ValueError("sigma must be positive")
     if(xi>=1/2):
         return float("infinity")
     return sigma/xi*math.sqrt(math.gamma(1-2*xi)-math.gamma(1-xi)**2)
Esempio n. 2
0
 def mean(mu,sigma,xi):
     if(xi==0):
         return extremevalue.random(mu,sigma)
     if(sigma<=0):
         raise ValueError("sigma must be positive")
     if(xi>=1):
         return float("infinity")
     return mu+sigma*(math.gamma(1-xi)-1)/xi
Esempio n. 3
0
 def kurtosis(mu,sigma,xi):
     if(xi==0):
         return extremevalue.random(mu,sigma)
     if(sigma<=0):
         raise ValueError("sigma must be positive")
     if(xi>=1/4):
         return float("infinity")
     return (math.gamma(1-4*xi)-4*math.gamma(1-xi)*math.gamma(1-3*xi)+6*math.gamma(1-2*xi)*(math.gamma(1-xi)**2)-3*(math.gamma(1-xi)**4))/math.pow(math.gamma(1-2*xi)-math.gamma(1-xi)**2,2)-3
Esempio n. 4
0
 def skewness(mu,sigma,xi):
     if(xi==0):
         return extremevalue.random(mu,sigma)
     if(sigma<=0):
         raise ValueError("sigma must be positive")
     if(xi>=1/3):
         return float("infinity")
     return (abs(xi)/xi)*(math.gamma(1-3*xi)-3*math.gamma(1-xi)*math.gamma(1-2*xi)+2*math.gamma(1-xi)**3)/math.pow(math.gamma(1-2*xi)-math.gamma(1-xi)**2,3/2)
Esempio n. 5
0
 def entropy(mu,sigma,xi):
     if(xi==0):
         return extremevalue.random(mu,sigma)
     if(sigma<=0):
         raise ValueError("sigma must be positive")
     return math.log(sigma)+ds.euler_gamma*(xi+1)+1
Esempio n. 6
0
 def mode(mu,sigma,xi):
     if(xi==0):
         return extremevalue.random(mu,sigma)
     if(sigma<=0):
         raise ValueError("sigma must be positive")
     return mu+sigma*(math.pow(1+xi,-xi)-1)/xi
Esempio n. 7
0
 def random(mu,sigma,xi):
     if(xi==0):
         return extremevalue.random(mu,sigma)
     if(sigma<=0):
         raise ValueError("sigma must be positive")
     return mu+sigma*(math.pow(math.log(1/ds.rg0()),-xi)-1)/xi