normal

final class boring_math.probability_distributions.distributions.normal.Normal

Bases: ContDist

Class for visualizing Normal distributions.

Note

The Normal, also called Gaussian, distribution is a continuous probability distribution with probability density function

f(x) = (1/√(2πσ²))exp(-(x-μ)²/2σ²)

where

  • μ is the mean value

  • σ is the standard deviation

__init__(mu: float = 0.0, sigma: float = 1.0)
__repr__() str
Returns:

The string Normal(μ, σ) where μ is the mean and σ is the std deviation of the distribution.

__str__() str
Returns:

The string Normal(mu=μ, sigma=σ) where μ is the mean and σ is the std deviation of the distribution.

pdf(x: float) float

Normal PDF

Normal probability distribution function.

Parameters:

xx [-∞, ∞]

Returns:

Value of the PDF at x

cdf(x: float) float

Normal cumulative probability distribution function.

__add__(other: Self | float) Self

Add together two Normal distributions.

Normal distributions are stable, thus if two independent random variables X₁ and X₂ are Normally distributed then aX₁ + bX₂ is also Normally distributed with μ = μ₁ + μ₂ and σ² = a²σ₁² + b²σ₂².

__mul__(factor: float) Self

Scale Normal distribution by a non-zero factor.

__rmul__(factor: float) Self

Scale Normal distribution by a non-zero factor.