java.lang.Object
org.bzdev.math.rv.RandomVariable<Double>
org.bzdev.math.rv.DoubleRandomVariable
org.bzdev.math.rv.GaussianRV
- All Implemented Interfaces:
Cloneable,RandomVariableOps<Double>
Random variable with a Gaussian distribution.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublegetMean()Get the mean value for the random-variable.doublegetSDev()Get the standard deviation for the random variable.next()Get the next value for a random variable.doublenext(int n) Get the sum of multiple values with the number of values an int.next(long n) Get the sum of multiple values with the number of values a long.toString()Methods inherited from class org.bzdev.math.rv.DoubleRandomVariable
getMaximum, getMaximumClosed, getMinimum, getMinimumClosed, parallelStream, parallelStream, rangeTestFailed, rangeTestNeeded, setMaximum, setMinimum, setRequiredMaximum, setRequiredMinimum, spliterator, spliterator, stream, stream, tightenMaximum, tightenMaximumS, tightenMinimum, tightenMinimumSMethods inherited from class org.bzdev.math.rv.RandomVariable
clone, getCharacteristics
-
Constructor Details
-
GaussianRV
public GaussianRV(double mean, double sdev) Constructor.- Parameters:
mean- the mean value of this random variablesdev- the standard deviation of this random variable
-
-
Method Details
-
getMean
public double getMean()Get the mean value for the random-variable.- Returns:
- the mean value
-
getSDev
public double getSDev()Get the standard deviation for the random variable.- Returns:
- the standard deviation
-
next
Description copied from class:RandomVariableGet the next value for a random variable. In general, each value will be independent of the last.- Specified by:
nextin interfaceRandomVariableOps<Double>- Specified by:
nextin classRandomVariable<Double>- Returns:
- the next value
-
next
public double next(int n) Get the sum of multiple values with the number of values an int. The range check, if any, is applied to the result, not the individual random values that were summed. The implementation is more efficient than one that calls next() n times.- Parameters:
n- the number of values to use- Returns:
- the sum of n values of this random variable
-
next
Get the sum of multiple values with the number of values a long. The range check, if any, is applied to the result, not the individual random values that were summed. The implementation is more efficient than one that calls next() n times.- Parameters:
n- the number of values to use- Returns:
- the sum of n values of this random variable
-
toString
-