{ } Raw JSON

bundles / scipy 1.17.1 / scipy / stats / _probability_distribution / _ProbabilityDistribution / iccdf

function

scipy.stats._probability_distribution:_ProbabilityDistribution.iccdf

source: /scipy/stats/_probability_distribution.py :1342

Signature

def   iccdf ( self p / method )

Summary

Inverse complementary cumulative distribution function.

Extended Summary

The inverse complementary cumulative distribution function ("inverse CCDF"), denoted , is the argument for which the complementary cumulative distribution function evaluates to .

When a strict "inverse" of the complementary cumulative distribution function does not exist (e.g. discrete random variables), the "inverse CCDF" is defined by convention as the smallest value within the support for which is no greater than .

iccdf accepts p for .

Parameters

p : array_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

out : array

The inverse CCDF evaluated at the provided argument.

Notes

Suppose a 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 returns nan.

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)
np.allclose(X.iccdf(0.25), X.icdf(1-0.25))
This function returns NaN when the argument is outside the domain.
X.iccdf([-0.1, 0, 1, 1.1])

See also

icdf
ilogccdf

Aliases

  • scipy.stats._distribution_infrastructure._ProbabilityDistribution.iccdf