statistics.NormalDist.inv_cdf(p)
The inv_cdf ("Inverse Cumulative Distribution Function") method of an object of type statistics.NormalDist returns the inverse cumulative distribution function, also known as the quantile function or the percent-point function. That is, it returns the value of the random variable for which the probability that the variable is less than or equal to said value matches the value passed as an argument.
- p: Probability of the distribution. It should be a real value in the open interval (0, 1).
The statistics.NormalDist.inv_cdf method returns a value of type float.
If we start from the following normal distribution:
...we can obtain the value for which the probability that the variable takes a value equal to or less than it is equal to 0.8 with the following code:
value
Indeed: