pub struct Normal { /* private fields */ }Expand description
Normal (Gaussian) distribution N(μ, σ²).
§Mathematical Definition
- PDF: φ(x) = (1/(σ√(2π))) exp(−(x−μ)²/(2σ²))
- CDF: Φ((x−μ)/σ) (via standard normal CDF)
- Mean: μ
- Variance: σ²
Implementations§
Source§impl Normal
impl Normal
Sourcepub fn new(mu: f64, sigma: f64) -> Result<Self, DistributionError>
pub fn new(mu: f64, sigma: f64) -> Result<Self, DistributionError>
Creates a new normal distribution N(μ, σ).
§Errors
Returns Err if sigma ≤ 0 or parameters are not finite.
pub fn mu(&self) -> f64
pub fn sigma(&self) -> f64
pub fn mean(&self) -> f64
pub fn variance(&self) -> f64
pub fn std_dev(&self) -> f64
Trait Implementations§
impl StructuralPartialEq for Normal
Auto Trait Implementations§
impl Freeze for Normal
impl RefUnwindSafe for Normal
impl Send for Normal
impl Sync for Normal
impl Unpin for Normal
impl UnsafeUnpin for Normal
impl UnwindSafe for Normal
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more