bundles / scipy latest / scipy / stats / _probability_distribution / _ProbabilityDistribution / cdf
function
scipy.stats._probability_distribution:_ProbabilityDistribution.cdf
Signature
def cdf ( self , x , y , / , method ) Summary
Cumulative distribution function
Extended Summary
The cumulative distribution function ("CDF"), denoted , is the probability the random variable will assume a value less than or equal to :
A two-argument variant of this function is also defined as the probability the random variable will assume a value between and .
cdf accepts x for and y for .
Parameters
x, y: array_likeThe arguments of the CDF.
xis required;yis optional.method: {None, 'formula', 'logexp', 'complement', 'quadrature', 'subtraction'}The strategy used to evaluate the CDF. By default (
None), the one-argument form of the function chooses between the following options, listed in order of precedence.'formula': use a formula for the CDF itself'logexp': evaluate the log-CDF and exponentiate'complement': evaluate the CCDF and take the complement'quadrature': numerically integrate the PDF (or, in the discrete case, sum the PMF)
In place of
'complement', the two-argument form accepts:'subtraction': compute the CDF at each argument and take the difference.
Not all
methodoptions are available for all distributions. If the selectedmethodis not available, aNotImplementedErrorwill be raised.
Returns
out: arrayThe CDF evaluated at the provided argument(s).
Notes
Suppose a continuous probability distribution has support . The CDF is related to the probability density function by:
The two argument version is:
The CDF evaluates to its minimum value of for and its maximum value of for .
Suppose a discrete probability distribution has support . The CDF is related to the probability mass function by:
The CDF evaluates to its minimum value of for and its maximum value of for .
The CDF is also known simply as the "distribution function".
Examples
Instantiate a distribution with the desired parameters:from scipy import stats X = stats.Uniform(a=-0.5, b=0.5)✓
X.cdf(0.25)
✗X.cdf(-0.25, 0.25) == X.cdf(0.25) - X.cdf(-0.25)
✗See also
Aliases
-
scipy.stats._distribution_infrastructure._ProbabilityDistribution.cdf