scipy.stats.VonMises.

cdf#

VonMises.cdf(x, y=None, /, *, method=None)[source]#

Cumulative distribution function

The cumulative distribution function (“CDF”), denoted \(F(x)\) is the probability that a random variable \(X\) will assume a value less than or equal to \(x\):

\[F(x) = P(X ≤ x)\]

for \(x\) within the support.

A two-argument variant of this function is also defined as the probability the random variable \(X\) will assume a value between \(x\) and \(y\).

\[F(x, y) = P(x ≤ X ≤ y)\]

cdf accepts x for \(x\) and y for \(y\).

Parameters:
x, yarray_like

The arguments of the CDF. x is required; y is 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 method options are available for all distributions. If the selected method is not available, a NotImplementedError will be raised.

Returns:
outarray

The CDF evaluated at the provided argument(s).

See also

logcdf
ccdf

Notes

Suppose a continuous probability distribution has support \([l, r]\). The CDF \(F(x)\) is related to the probability density function \(f(x)\) by:

\[F(x) = \int_l^x f(u) du\]

The two argument version is:

\[F(x, y) = \int_x^y f(u) du = F(y) - F(x)\]

Currently, the two argument version is implemented only for continuous distributions; for circular distributions, it raises a NotImplementedError.

For real line distributions, the CDF evaluates to its minimum value of \(0\) for \(x ≤ l\) and its maximum value of \(1\) for \(x ≥ r\).

For circular distributions, the CDF evaluates to \(0\) at \(x = l\), but the distribution function is periodic ([2] 25):

\[F(x + 2\pi) - F(x) = 1, \quad -\infty < x < \infty.\]

Suppose a discrete probability distribution has support \([l, r]\). The CDF \(F(x)\) is related to the probability mass function \(f(x)\) by:

\[F(x) = \sum_{u=l}^{\lfloor x \rfloor} f(u)\]

The CDF evaluates to its minimum value of \(0\) for \(x < l\) and its maximum value of \(1\) for \(x ≥ r\).

The CDF is also known simply as the “distribution function”, especially for circular distributions.

References

[1]

Cumulative distribution function, Wikipedia, https://en.wikipedia.org/wiki/Cumulative_distribution_function

[2]

Mardia, Kanti V., and Peter E. Jupp. Directional statistics. John Wiley & Sons, 1999. DOI:10.1002/9780470316979.

Examples

Instantiate a distribution with the desired parameters:

>>> from scipy import stats
>>> X = stats.Uniform(a=-0.5, b=0.5)

Evaluate the CDF at the desired argument:

>>> X.cdf(0.25)
0.75

Evaluate the cumulative probability between two arguments:

>>> X.cdf(-0.25, 0.25) == X.cdf(0.25) - X.cdf(-0.25)
True