Utility
Class Beta

java.lang.Object
  |
  +--Utility.RandomNumber
        |
        +--Utility.Beta

public class Beta
extends RandomNumber

Beta is used to generate random variables from the Beta distribution. A specific beta distribution is characterized by two parameters, both representing degrees of freedom.

This is a continuous distribution.

Tests Performed
1000 samples were generated and the means and variances were examined. Subjectively, they seemed correct. Goodness of fit tests where not performed.


Constructor Summary
Beta(int degsFreedom1, int degsFreedom2)
          Beta constructor.
 
Method Summary
 double sampleDouble()
          The sampleDouble function returns a random variable that is chosen from a beta distribution with parameters as set in the constructor.
 int sampleInt()
          The sampleInt function should not be called for this continuous distribution.
 
Methods inherited from class Utility.RandomNumber
goodnessOfFitTest, goodnessOfFitTest, randomMixer, resetRandomMixer, sample01
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Beta

public Beta(int degsFreedom1,
            int degsFreedom2)
Beta constructor. Initialize the parameters of the beta distribution.

Parameters:
degsFreedom1 - The first degrees of freedom parameter
degsFreedom2 - The second degrees of freedom parameter
Method Detail

sampleDouble

public double sampleDouble()
The sampleDouble function returns a random variable that is chosen from a beta distribution with parameters as set in the constructor.
Algorithm is found in Knuth, "The Art of Comp. Programming" Volume 2.

Overrides:
sampleDouble in class RandomNumber
See Also:
Beta(int, int)

sampleInt

public int sampleInt()
The sampleInt function should not be called for this continuous distribution.

Overrides:
sampleInt in class RandomNumber