Statistics.Distributions.Normal

The normal, or gaussian, distribution

Summary

cdf(x)

Get the probability that a value lies below x

cdf(x, mu, sigma)
pdf(x)

Probability density function

pdf(x, mu, sigma)
ppf(x)

The percentile-point function

ppf(x, mu, sigma)
rand()

Draw a random number from a normal distribution

rand(mu, sigma)

Functions

cdf(x)

Get the probability that a value lies below x

Cumulative gives a probability that a statistic is less than Z. This equates to the area of the distribution below Z. e.g: Pr(Z = 0.69) = 0.7549. This value is usually given in Z tables.

Examples

iex> Statistics.Distributions.Normal.cdf(2) 0.9772499371127437 iex> Statistics.Distributions.Normal.cdf(0) 0.5000000005

cdf(x, mu, sigma)
pdf(x)

Probability density function

get result of probability density function

Examples

iex> Statistics.Distributions.Normal.pdf(0) 
0.3989422804014327
iex> Statistics.Distributions.Normal.pdf(1.3, 0.2, 1)
0.21785217703255055
pdf(x, mu, sigma)
ppf(x)

The percentile-point function

Get the maximum point which lies below the given probability. This is the inverse of the cdf

Examples

iex> Statistics.Distributions.Normal.ppf(0.025) 
-1.96039491692534
iex> Statistics.Distributions.Normal.ppf(0.25, 7, 2.1)
5.584202805909036
ppf(x, mu, sigma)
rand()

Draw a random number from a normal distribution

rnd/0 will return a random number from a normal distribution with a mean of 0 and a standard deviation of 1

rnd/3 allows you to provide the mean and standard deviation parameters of the distribution from which the random number is drawn

Uses the rejection sampling method

Examples

iex> Statistics.Distributions.Normal.rand()
1.5990817245679434
iex> Statistics.Distributions.Normal.rand(22, 2.3)
23.900248900049736
rand(mu, sigma)