Class Erlang
-
- All Implemented Interfaces:
-
java.io.Serializable,jline.lang.Copyable
public class Erlang extends Markovian implements Serializable
An Erlang-n distribution with n phases.
-
-
Constructor Summary
Constructors Constructor Description Erlang(double phaseRate, int n)Creates an Erlang distribution with the specified phase rate and number of phases.
-
Method Summary
Modifier and Type Method Description static ErlangfitMeanAndOrder(double mean, long numPhases)Creates an Erlang distribution fitted to the specified mean and number of phases. static ErlangfitMeanAndSCV(double mean, double SCV)Creates an Erlang distribution fitted to the specified mean and squared coefficient of variation. static ErlangfitMeanAndStdDev(double mean, double stdDev)Creates an Erlang distribution fitted to the specified mean and standard deviation. doubleevalCDF(double t)Evaluates the cumulative distribution function at the given point. doubleevalLST(double s)Evaluates the Laplace-Stieltjes transform at the given point. doublegetMean()Gets the mean of this Erlang distribution. doublegetRate()Gets the rate of this Erlang distribution. doublegetSCV()Gets the squared coefficient of variation. doublegetSkewness()Gets the skewness of this Erlang distribution. doublegetVar()Gets the variance of this Erlang distribution. Array<double>sample(int n, Random random)Generates random samples from this distribution using the specified random generator. Array<double>sample(int n)Generates random samples from this distribution using default random generator. doublemean()Kotlin-style property alias for getMean() doublerate()Kotlin-style property alias for getRate() doublescv()Kotlin-style property alias for getSCV() doubleskewness()Kotlin-style property alias for getSkewness() doublevar()Kotlin-style property alias for getVar() -
Methods inherited from class jline.lang.processes.Markovian
D, acf, embedded, embeddedProb, evalCDF, evalMeanT, evalVarT, getACF, getEmbedded, getEmbeddedProb, getIDC, getIDI, getInitProb, getMoments, getMu, getNumberOfPhases, getPhi, getProcess, getSubgenerator, getVariance, idc, idi, initProb, moments, mu, numPhases, numberOfPhases, phi, process, setMean, setProcess, setRate, subgenerator, variance -
Methods inherited from class jline.lang.processes.Distribution
evalProbInterval, getName, getNumParams, getParam, getSupport, isContinuous, isDisabled, isDiscrete, isImmediate, isMarkovian, name, numParams, param, setNumParams, setParam, support -
Methods inherited from class jline.lang.Copyable
copy -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
fitMeanAndOrder
static Erlang fitMeanAndOrder(double mean, long numPhases)
Creates an Erlang distribution fitted to the specified mean and number of phases.
- Parameters:
mean- the desired mean valuenumPhases- the number of phases- Returns:
an Erlang distribution with the specified characteristics
-
fitMeanAndSCV
static Erlang fitMeanAndSCV(double mean, double SCV)
Creates an Erlang distribution fitted to the specified mean and squared coefficient of variation.
- Parameters:
mean- the desired mean valueSCV- the desired squared coefficient of variation- Returns:
an Erlang distribution with the specified characteristics
-
fitMeanAndStdDev
static Erlang fitMeanAndStdDev(double mean, double stdDev)
Creates an Erlang distribution fitted to the specified mean and standard deviation.
- Parameters:
mean- the desired mean valuestdDev- the desired standard deviation- Returns:
an Erlang distribution with the specified characteristics
-
evalCDF
double evalCDF(double t)
Evaluates the cumulative distribution function at the given point.
- Parameters:
t- the point at which to evaluate the CDF- Returns:
the CDF value at point t
-
evalLST
double evalLST(double s)
Evaluates the Laplace-Stieltjes transform at the given point.
- Parameters:
s- the transform variable- Returns:
the LST value (α/(α+s))^r
-
getMean
double getMean()
Gets the mean of this Erlang distribution.
- Returns:
the mean value (r/α)
-
getRate
double getRate()
Gets the rate of this Erlang distribution.
- Returns:
the rate (α/r)
-
getSCV
double getSCV()
Gets the squared coefficient of variation.
- Returns:
the SCV (1/r)
-
getSkewness
double getSkewness()
Gets the skewness of this Erlang distribution.
- Returns:
the skewness (2/√r)
-
getVar
double getVar()
Gets the variance of this Erlang distribution.
- Returns:
the variance (r/α²)
-
sample
Array<double> sample(int n, Random random)
Generates random samples from this distribution using the specified random generator.
- Parameters:
n- the number of samples to generaterandom- the random number generator to use- Returns:
array of random samples
-
sample
Array<double> sample(int n)
Generates random samples from this distribution using default random generator.
- Parameters:
n- the number of samples to generate- Returns:
array of random samples
-
mean
double mean()
Kotlin-style property alias for getMean()
-
rate
double rate()
Kotlin-style property alias for getRate()
-
scv
double scv()
Kotlin-style property alias for getSCV()
-
skewness
double skewness()
Kotlin-style property alias for getSkewness()
-
var
double var()
Kotlin-style property alias for getVar()
-
-
-
-