jsim.variate
Class ChiSquare

java.lang.Object
  extended by jsim.variate.Variate
      extended by jsim.variate.ChiSquare

public class ChiSquare
extends Variate

Chi-Square (n degrees of freedom) random variate generation.


Constructor Summary
ChiSquare(double n, int i)
          Constructs a Chi Square random variate.
ChiSquare(int n, int i)
          Constructs a Chi Square random variate.
 
Method Summary
 double gen()
          Generate a random number from the Chi Square distribution.
 java.lang.Double[] getParameters()
          Get the parameters of the constuctor
 
Methods inherited from class jsim.variate.Variate
incStream, printName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChiSquare

public ChiSquare(int n,
                 int i)
Constructs a Chi Square random variate.

Parameters:
n - degrees of freedom
i - random number stream

ChiSquare

public ChiSquare(double n,
                 int i)
Constructs a Chi Square random variate.

Parameters:
n - degrees of freedom (double will get truncated to int)
i - random number stream
Method Detail

getParameters

public java.lang.Double[] getParameters()
Get the parameters of the constuctor

Overrides:
getParameters in class Variate

gen

public double gen()
Generate a random number from the Chi Square distribution.

Overrides:
gen in class Variate
Returns:
double random number from Chi Square distribution