iccdf#
- Mixture.iccdf(p, /, *, method=None)[source]#
Inverse complementary cumulative distribution function.
The inverse complementary cumulative distribution function (“inverse CCDF”), denoted , is the argument for which the complementary cumulative distribution function evaluates to .
iccdf
accepts p for .- Parameters:
- parray_like
The argument of the inverse CCDF.
- method{None, ‘formula’, ‘complement’, ‘inversion’}
The strategy used to evaluate the inverse CCDF. By default (
None
), the infrastructure chooses between the following options, listed in order of precedence.'formula'
: use a formula for the inverse CCDF itself'complement'
: evaluate the inverse CDF at the complement of p'inversion'
: solve numerically for the argument at which the CCDF 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:
- outarray
The inverse CCDF evaluated at the provided argument.
Notes
Suppose a continuous probability distribution has support . The inverse CCDF returns its minimum value of at and its maximum value of at . Because the CCDF has range , the inverse CCDF is only defined on the domain ; for and ,
iccdf
returnsnan
.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 CCDF at the desired argument:
>>> X.iccdf(0.25) 0.25 >>> np.allclose(X.iccdf(0.25), X.icdf(1-0.25)) True
This function returns NaN when the argument is outside the domain.
>>> X.iccdf([-0.1, 0, 1, 1.1]) array([ nan, 0.5, -0.5, nan])