public class NormDistribution extends ContinuousDistribution
name
Constructor and Description |
---|
NormDistribution(java.lang.String name,
double mean,
double variance)
Creates a (univariate) normal distribution based on the math3.distribution library of the apache commons.
|
Modifier and Type | Method and Description |
---|---|
double |
draw()
Draw a value from the distribution according to the distribution at hand
|
double |
getMean() |
double |
getVariance() |
getName, toString
public NormDistribution(java.lang.String name, double mean, double variance) throws java.lang.IllegalArgumentException
name
- Name associated with the normal distribution (will be prefixed by NormalDistribution_)mean
- Mean value of the distributionvariance
- Variance of the distributionjava.lang.IllegalArgumentException
- will be thrown when the variance is negative (which doesnt make any sense)public double getMean()
public double getVariance()
public double draw()
UnivariateDistribution
draw
in class UnivariateDistribution