lement'``: evaluate the inverse CCDF at the complement of `p` - ``'inversion'``: solve numerically for the argument at which the CDF is equal to `p` Not all `method` options are available for all distributions. If the selected `method` is not available, a ``NotImplementedError`` will be raised. Returns ------- out : array The inverse CDF evaluated at the provided argument. See Also -------- cdf ilogcdf Notes ----- Suppose a continuous probability distribution has support :math:`[l, r]`. The inverse CDF returns its minimum value of :math:`l` at :math:`p = 0` and its maximum value of :math:`r` at :math:`p = 1`. Because the CDF has range :math:`[0, 1]`, the inverse CDF is only defined on the domain :math:`[0, 1]`; for :math:`p < 0` and :math:`p > 1`, `icdf` returns ``nan``. The inverse CDF is also known as the quantile function, percentile function, and percent-point function. References ---------- .. [1] Quantile function, *Wikipedia*, https://en.wikipedia.org/wiki/Quantile_function Examples -------- Instantiate a distribution with the desired parameters: >>> import numpy as np >>> from scipy import stats >>> X = stats.Uniform(a=-0.5, b=0.5) Evaluate the inverse CDF at the desired argument: >>> X.icdf(0.25) -0.25 >>> np.allclose(X.cdf(X.icdf(0.25)), 0.25) True This function returns NaN when the argument is outside the domain. >>> X.icdf([-0.1, 0, 1, 1.1]) array([ nan, -0.5, 0.5, nan]) r