Stats for Y = e^X where X ~ U(low, high).
| 11 | |
| 12 | |
| 13 | class loguniform_gen(rv_continuous): |
| 14 | """Stats for Y = e^X where X ~ U(low, high).""" |
| 15 | |
| 16 | def __init__(self, low=0, high=1): |
| 17 | rv_continuous.__init__(self, a=np.exp(low), b=np.exp(high)) |
| 18 | self._low = low |
| 19 | self._high = high |
| 20 | |
| 21 | def _rvs(self): |
| 22 | rval = np.exp(mtrand.uniform(self._low, self._high, self._size)) |
| 23 | return rval |
| 24 | |
| 25 | def _pdf(self, x): |
| 26 | return old_div(1.0, (x * (self._high - self._low))) |
| 27 | |
| 28 | def _logpdf(self, x): |
| 29 | return -np.log(x) - np.log(self._high - self._low) |
| 30 | |
| 31 | def _cdf(self, x): |
| 32 | return old_div((np.log(x) - self._low), (self._high - self._low)) |
| 33 | |
| 34 | |
| 35 | class lognorm_gen(scipy_lognorm_gen): |
no outgoing calls