class Statistics::Distributions::Normal

Overview

Represents a normal distribution.

See wikipedia for more details.

Defined in:

lib/distributions.cr

Constant Summary

PDF_COEFFICIENT = 1 / (Math.sqrt(TWO_PI))
TWO_PI = 2 * Math::PI

Constructors

Instance Method Summary

Instance methods inherited from class Statistics::Distributions::ContinuousDistribution

pdf(x) pdf

Instance methods inherited from class Statistics::Distributions::Distribution(Float64)

rand : T rand

Constructor Detail

def self.new(mean : Float64 = 0, std : Float64 = 1) #

Creates a normal distribution with the given mean and std.


Instance Method Detail

def pdf(x) #

The Probability Density Function (PDF) of a continuous random variable.


def rand : Float64 #
Description copied from class Statistics::Distributions::Distribution(Float64)

Samples a random variable with the given distribution.