public class InverseGaussianVariate extends RandomVariateBase
Modifier and Type | Field and Description |
---|---|
private double |
lambda
The scale factor.
|
private double |
mu
The mean.
|
private NormalVariate |
normal
The instance of the NormalVariate that is used to generate Inverse
Gaussian.
|
rng
Constructor and Description |
---|
InverseGaussianVariate()
Creates a new InverseGaussian without setting the parameters.
|
Modifier and Type | Method and Description |
---|---|
double |
generate()
Generate a random variate having an Inverse Gaussian distribution
|
double |
getLambda() |
double |
getMu() |
java.lang.Object[] |
getParameters()
Returns a two element array containing mu (the mean) and lambda (the
scale).
|
void |
setLambda(double lambda) |
void |
setMu(double mu) |
void |
setParameters(java.lang.Object... params)
Sets μ (the mean) and ƛ (the scale) to the values given.
|
java.lang.String |
toString()
Returns a String containing the name of this distribution and its
parameters.
|
getRandomNumber, setRandomNumber
private double lambda
private double mu
private final NormalVariate normal
public InverseGaussianVariate()
public double generate()
public java.lang.Object[] getParameters()
public void setParameters(java.lang.Object... params)
params
- A two element array containing me and lambda as Numbersjava.lang.IllegalArgumentException
- If the array does not contain exactly
two Numbers or if lambda is not positive.public void setMu(double mu)
mu
- the mean (μ).public double getMu()
public void setLambda(double lambda)
lambda
- the scale ( λ)java.lang.IllegalArgumentException
- If lambda ≤ 0.0.public double getLambda()
public java.lang.String toString()
toString
in class java.lang.Object