public class BetaVariate extends RandomVariateBase
The pdf is f(x) = xα-1(1-x)β-1, 0≤x≤1
Parameters:
alpha
: α in pdfbeta
: β in pdfRandomVariateFactory.getInstance(...)
Modifier and Type | Field and Description |
---|---|
private double |
alpha |
private double |
beta |
private RandomVariate |
gammaVariate1 |
private RandomVariate |
gammaVariate2 |
protected double |
max |
protected double |
min |
rng
Constructor and Description |
---|
BetaVariate()
Creates a new BetaVariate.
|
Modifier and Type | Method and Description |
---|---|
double |
generate()
Generates the next value of this variate.
|
double |
getAlpha() |
double |
getBeta() |
double |
getMax() |
double |
getMin() |
java.lang.Object[] |
getParameters()
Returns an array containing the parameters alpha and beta as Objects.
|
void |
setAlpha(double alpha) |
void |
setBeta(double beta) |
private void |
setGammas()
Creates the two instances of GammaVariate used to generate this
BetaVariate.
|
void |
setMax(double max) |
void |
setMin(double min) |
void |
setParameters(java.lang.Object... params)
Sets the parameters alpha and beta to the contents of the array.
|
java.lang.String |
toString() |
getRandomNumber, setRandomNumber
private double alpha
private double beta
protected double min
protected double max
private RandomVariate gammaVariate1
private RandomVariate gammaVariate2
public BetaVariate()
public double generate()
public void setParameters(java.lang.Object... params)
params
- A two element array containing alpha, beta as Numbersjava.lang.IllegalArgumentException
- If the parameter array does not contain
exactly two parameters, or either of the parameters is not a Number
greater than zero.public java.lang.Object[] getParameters()
private void setGammas()
public double getAlpha()
public double getBeta()
public void setAlpha(double alpha)
alpha
- α parameterjava.lang.IllegalArgumentException
- If alpha is not greater than 0.0.public void setBeta(double beta)
beta
- β parameterjava.lang.IllegalArgumentException
- If beta is not greater than 0.0.public java.lang.String toString()
toString
in class java.lang.Object
public double getMin()
public void setMin(double min)
min
- the min to setpublic double getMax()
public void setMax(double max)
max
- the max to set