Class GaussianRV

All Implemented Interfaces:
Cloneable, RandomVariableOps<Double>

public class GaussianRV extends DoubleRandomVariable
Random variable with a Gaussian distribution.
  • Constructor Details

    • GaussianRV

      public GaussianRV(double mean, double sdev)
      Constructor.
      Parameters:
      mean - the mean value of this random variable
      sdev - 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

      public Double next()
      Description copied from class: RandomVariable
      Get the next value for a random variable. In general, each value will be independent of the last.
      Specified by:
      next in interface RandomVariableOps<Double>
      Specified by:
      next in class RandomVariable<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

      public Double next(long n)
      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

      public String toString()
      Overrides:
      toString in class Object