bundles / scipy 1.17.1 / scipy / stats / _probability_distribution / _ProbabilityDistribution / ccdf
function
scipy.stats._probability_distribution:_ProbabilityDistribution.ccdf
Signature
def ccdf ( self , x , y , / , method ) Summary
Complementary cumulative distribution function
Extended Summary
The complementary cumulative distribution function ("CCDF"), denoted , is the complement of the cumulative distribution function ; i.e., probability the random variable will assume a value greater than :
A two-argument variant of this function is:
ccdf accepts x for and y for .
Parameters
x, y: array_likeThe arguments of the CCDF.
xis required;yis optional.method: {None, 'formula', 'logexp', 'complement', 'quadrature', 'addition'}The strategy used to evaluate the CCDF. By default (
None), the infrastructure chooses between the following options, listed in order of precedence.'formula': use a formula for the CCDF itself'logexp': evaluate the log-CCDF and exponentiate'complement': evaluate the CDF and take the complement'quadrature': numerically integrate the PDF (or, in the discrete case, sum the PMF)
The two-argument form chooses between:
'formula': use a formula for the CCDF itself'addition': compute the CDF atxand the CCDF aty, then add
Not all
methodoptions are available for all distributions. If the selectedmethodis not available, aNotImplementedErrorwill be raised.
Returns
out: arrayThe CCDF evaluated at the provided argument(s).
Notes
Suppose a continuous probability distribution has support . The CCDF is related to the probability density function by:
The two argument version is:
The CCDF returns its minimum value of for and its maximum value of for .
Suppose a discrete probability distribution has support . The CCDF is related to the probability mass function by:
The CCDF evaluates to its minimum value of for and its maximum value of for .
The CCDF is also known as the "survival 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)✓
X.ccdf(0.25)
✗np.allclose(X.ccdf(0.25), 1-X.cdf(0.25))
✓X.ccdf(-0.25, 0.25) == X.cdf(-0.25) + X.ccdf(0.25)
✗See also
Aliases
-
scipy.stats._distribution_infrastructure._ProbabilityDistribution.ccdf