{ } Raw JSON

bundles / scipy latest / scipy / stats / _probability_distribution / _ProbabilityDistribution / ccdf

function

scipy.stats._probability_distribution:_ProbabilityDistribution.ccdf

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

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_like

The arguments of the CCDF. x is required; y is 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 at x and the CCDF at y, then add

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 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)
Evaluate the CCDF at the desired argument:
X.ccdf(0.25)
np.allclose(X.ccdf(0.25), 1-X.cdf(0.25))
Evaluate the complement of the cumulative probability between two arguments:
X.ccdf(-0.25, 0.25) == X.cdf(-0.25) + X.ccdf(0.25)

See also

cdf
logccdf

Aliases

  • scipy.stats._distribution_infrastructure._ProbabilityDistribution.ccdf