MCPcopy Index your code
hub / github.com/python/cpython / inv_cdf

Method inv_cdf

Lib/statistics.py:1272–1284  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.

Callers 2

quantilesMethod · 0.95
test_inv_cdfMethod · 0.95

Calls 2

StatisticsErrorClass · 0.85
_normal_dist_inv_cdfFunction · 0.85

Tested by 1

test_inv_cdfMethod · 0.76