public class ErlangDistribution extends COLTContinuousDistribution
generatorname| Constructor and Description |
|---|
ErlangDistribution(java.lang.String name,
int k,
double lambda)
Generate an Erlang distribution from the parameters k (shape) and lambda (rate),
which is used to draw values based on the mean and variance of the distribution as implemented in the COLT library
|
| Modifier and Type | Method and Description |
|---|---|
double |
draw()
Draw a value from the distribution according to the distribution at hand
|
double |
drawValue()
Value is drawn using the nextErlang-function of the COLT distributions
|
int |
k() |
double |
lambda() |
void |
setK(int k)
Resets the shape parameter k of the distribution.
|
void |
setLambda(double lambda)
Resets the rate parameter lambda of the distribution.
|
getName, toStringpublic ErlangDistribution(java.lang.String name,
int k,
double lambda)
name - The name of the distribution used (will be prefixed by ErlangDistribution_)k - The shape parameter of the Erlang distributionlambda - The rate parameter of the Erlang distributionjava.lang.IllegalArgumentException - will be thrown when either parameter is out of range (<= 0)public int k()
public double lambda()
public void setK(int k)
throws java.lang.IllegalArgumentException
k - shape parameter to replace current onejava.lang.IllegalArgumentException - Will be thrown when k <= 0public void setLambda(double lambda)
throws java.lang.IllegalArgumentException
lambda - rate parameter to replace current onejava.lang.IllegalArgumentException - Will be thrown when lambda <= 0public double drawValue()
public double draw()
UnivariateDistributiondraw in class UnivariateDistribution