-
Notifications
You must be signed in to change notification settings - Fork 0
Normal
One of the most useful distributions out there especially when dealing with a significant sample size. I will be adding normal approximation in the future or may create two separate distributions, one for dealing with discrete data (Populations, Cars etc...) and one for continuous (Weight, Height, Currency etc...).
How to create your own Normal Distribution
//Mean in liters
double AverageWaterUsed = 20;
//Variance in liters^2
double VarianceWaterUsed = 4;
Normal norm = new Normal(AverageWaterUsed, VarianceWaterUsed);
To get Probability of an event occurring it is very simple. This is the probability that less than 16L will be consumed on a given day assuming Normal Distribution.
double WaterConsumedToday = 16;
var prob = norm.GetProbabilityLessThan(WaterConsumedToday); //0.02275... Around 2.3%
Note: As this is dealing with continuous data only norm.GetProbabilityLessThanOrEqual() will be the same as norm.GetProbabilityLessThan() and they will both be equal to 1-norm.GetProbabilityMoreThanOrEqual() and 1-GetProbabilityMoreThan()