Weibull distribution. alpha is the scale parameter and beta is the shape parameter.
(self, alpha, beta)
| 773 | return u ** (-1.0 / alpha) |
| 774 | |
| 775 | def weibullvariate(self, alpha, beta): |
| 776 | """Weibull distribution. |
| 777 | |
| 778 | alpha is the scale parameter and beta is the shape parameter. |
| 779 | |
| 780 | """ |
| 781 | # Jain, pg. 499; bug fix courtesy Bill Arms |
| 782 | |
| 783 | u = 1.0 - self.random() |
| 784 | return alpha * (-_log(u)) ** (1.0 / beta) |
| 785 | |
| 786 | |
| 787 | ## -------------------- discrete distributions --------------------- |