Class ChiSquare

java.lang.Object
eduni.distributions.Generator
eduni.distributions.ChiSquare
All Implemented Interfaces:
ContinuousGenerator, Seedable

public class ChiSquare extends Generator implements ContinuousGenerator
A random number generator based on the Chi-Square distribution.
  • Constructor Details

    • ChiSquare

      public ChiSquare(long deg_freedom)
      the seed is automatically provided by the SeedGenerator
      Parameters:
      deg_freedom - The degrees of freedom for the distribution
    • ChiSquare

      public ChiSquare(long deg_freedom, long seed)
      The constructor with which a specific seed is set for the random number generator
      Parameters:
      deg_freedom - The degrees of freedom for the distribution
      seed - The initial seed for the generator, two instances with the same seed will generate the same sequence of numbers
  • Method Details

    • sample

      public double sample()
      Generate a new random number.
      Specified by:
      sample in interface ContinuousGenerator
      Returns:
      The next random number in the sequence