Inverse cumulative distribution function. x : P(X <= x) = p Finds the value of the random variable such that the probability of the variable being less than or equal to that value equals the given probability. This function is also called the percent point function
(self, p)
| 1270 | return 0.5 * erfc((self._mu - x) / (self._sigma * _SQRT2)) |
| 1271 | |
| 1272 | def inv_cdf(self, p): |
| 1273 | """Inverse cumulative distribution function. x : P(X <= x) = p |
| 1274 | |
| 1275 | Finds the value of the random variable such that the probability of |
| 1276 | the variable being less than or equal to that value equals the given |
| 1277 | probability. |
| 1278 | |
| 1279 | This function is also called the percent point function or quantile |
| 1280 | function. |
| 1281 | """ |
| 1282 | if p <= 0.0 or p >= 1.0: |
| 1283 | raise StatisticsError('p must be in the range 0.0 < p < 1.0') |
| 1284 | return _normal_dist_inv_cdf(p, self._mu, self._sigma) |
| 1285 | |
| 1286 | def quantiles(self, n=4): |
| 1287 | """Divide into *n* continuous intervals with equal probability. |