Skip to content

Distributions

norm

Functions for working with a normal continuous random variable.

Source code in python/rapidstats/_distributions.py
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
class norm:
    """Functions for working with a normal continuous random variable."""

    @staticmethod
    def ppf(q: float) -> float:
        r"""The percent point function. Also called the quantile, percentile, inverse
        CDF, or inverse distribution function. Computes the value of a random variable
        such that its probability is \( \leq q \). If `q` is 0, it returns negative
        infinity, if `q` is 1, it returns infinity. Any number outside of [0, 1] will
        result in NaN.

        Parameters
        ----------
        q : float
            Probability value

        Returns
        -------
        float
            Likelihood a random variable is realized in the range at or below `q` for
            the normal distribution.
        """
        return _norm_ppf(q)

    @staticmethod
    def cdf(x: float) -> float:
        r"""The cumulative distribution function.

        Parameters
        ----------
        x : float

        Returns
        -------
        float
            The probability a random variable will take a value \( \leq x \)
        """
        return _norm_cdf(x)

cdf(x) staticmethod

The cumulative distribution function.

Parameters:

Name Type Description Default
x float
required

Returns:

Type Description
float

The probability a random variable will take a value \( \leq x \)

Source code in python/rapidstats/_distributions.py
28
29
30
31
32
33
34
35
36
37
38
39
40
41
@staticmethod
def cdf(x: float) -> float:
    r"""The cumulative distribution function.

    Parameters
    ----------
    x : float

    Returns
    -------
    float
        The probability a random variable will take a value \( \leq x \)
    """
    return _norm_cdf(x)

ppf(q) staticmethod

The percent point function. Also called the quantile, percentile, inverse CDF, or inverse distribution function. Computes the value of a random variable such that its probability is \( \leq q \). If q is 0, it returns negative infinity, if q is 1, it returns infinity. Any number outside of [0, 1] will result in NaN.

Parameters:

Name Type Description Default
q float

Probability value

required

Returns:

Type Description
float

Likelihood a random variable is realized in the range at or below q for the normal distribution.

Source code in python/rapidstats/_distributions.py
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
@staticmethod
def ppf(q: float) -> float:
    r"""The percent point function. Also called the quantile, percentile, inverse
    CDF, or inverse distribution function. Computes the value of a random variable
    such that its probability is \( \leq q \). If `q` is 0, it returns negative
    infinity, if `q` is 1, it returns infinity. Any number outside of [0, 1] will
    result in NaN.

    Parameters
    ----------
    q : float
        Probability value

    Returns
    -------
    float
        Likelihood a random variable is realized in the range at or below `q` for
        the normal distribution.
    """
    return _norm_ppf(q)