Package jline.lang.processes
Class Erlang
java.lang.Object
jline.lang.processes.Distribution
jline.lang.processes.ContinuousDistribution
jline.lang.processes.Markovian
jline.lang.processes.Erlang
- All Implemented Interfaces:
Serializable,Copyable
An Erlang-n distribution with n phases.
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionErlang(double phaseRate, int n) Creates an Erlang distribution with the specified phase rate and number of phases. -
Method Summary
Modifier and TypeMethodDescriptiondoubleevalCDF(double t) Evaluates the cumulative distribution function at the given point.doubleevalLST(double s) Evaluates the Laplace-Stieltjes transform at the given point.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.doublegetMean()Gets the mean of this Erlang distribution.doublegetRate()Gets the rate of this Erlang distribution.doublegetSCV()Gets the squared coefficient of variation.doubleGets the skewness of this Erlang distribution.doublegetVar()Gets the variance of this Erlang distribution.doublemean()Property alias for getMeandoublerate()Property alias for getRatedouble[]sample(int n) Generates random samples from this distribution using default random generator.double[]Generates random samples from this distribution using the specified random generator.doublescv()Property alias for getSCVdoubleskewness()Property alias for getSkewnessdoublevar()Property alias for getVarMethods inherited from class jline.lang.processes.Markovian
acf, D, embedded, embeddedProb, evalCDF, evalLST, evalMeanT, evalVarT, getACF, getACF, getEmbedded, getEmbeddedProb, getIDC, getIDI, getInitProb, getMoments, getMu, getNumberOfPhases, getPhi, getProcess, getSubgenerator, getVariance, idc, idi, initProb, moments, mu, numberOfPhases, numPhases, phi, process, setMean, setProcess, setRate, subgenerator, varianceMethods inherited from class jline.lang.processes.Distribution
evalProbInterval, getFeatureName, getName, getNumParams, getNumParams, getParam, getParam, getParams, getSupport, hasParam, isContinuous, isDisabled, isDiscrete, isImmediate, isMarkovian, name, numParams, param, setNumParams, setParam, support
-
Constructor Details
-
Erlang
public Erlang(double phaseRate, int n) Creates an Erlang distribution with the specified phase rate and number of phases.- Parameters:
phaseRate- the rate parameter for each phasen- the number of phases
-
-
Method Details
-
fitMeanAndOrder
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
Creates an Erlang distribution fitted to the specified mean and squared coefficient of variation. An Erlang of order r has SCV = 1/r, so no Erlang has SCV > 1 and the request is refused rather than answered with the 1-phase Erlang, which is an exponential and therefore a distribution the caller did not ask for. Port of the guard in MATLAB Erlang.fitMeanAndSCV.- Parameters:
mean- the desired mean valueSCV- the desired squared coefficient of variation, which must be at most 1- Returns:
- an Erlang distribution with the specified characteristics
- Throws:
IllegalArgumentException- if the SCV exceeds 1
-
fitMeanAndStdDev
Creates an Erlang distribution fitted to the specified mean and standard deviation. The SCV is the squared coefficient of VARIATION, (stdDev/mean)^2. This read mean/stdDev^2, which is not dimensionless and is not the SCV of anything: at mean = 2 and stdDev = 2 (an exponential, SCV 1) it asked for SCV 0.5 and returned a 2-phase Erlang. JLINE-only entry point, with no MATLAB counterpart and no caller in the tree, so the defect was latent.- Parameters:
mean- the desired mean valuestdDev- the desired standard deviation- Returns:
- an Erlang distribution with the specified characteristics
-
evalCDF
public double evalCDF(double t) Evaluates the cumulative distribution function at the given point. -
evalLST
public double evalLST(double s) Evaluates the Laplace-Stieltjes transform at the given point. -
getMean
public double getMean()Gets the mean of this Erlang distribution. -
getRate
public double getRate()Gets the rate of this Erlang distribution. -
getSCV
public double getSCV()Gets the squared coefficient of variation. -
getSkewness
public double getSkewness()Gets the skewness of this Erlang distribution.- Overrides:
getSkewnessin classMarkovian- Returns:
- the skewness (2/√r)
-
getVar
public double getVar()Gets the variance of this Erlang distribution. -
sample
Description copied from class:DistributionGenerates random samples from this distribution using the specified random generator. -
sample
public double[] sample(int n) Description copied from class:DistributionGenerates random samples from this distribution using default random generator. -
mean
public double mean()Property alias for getMean -
rate
public double rate()Property alias for getRate -
scv
public double scv()Property alias for getSCV -
skewness
public double skewness()Property alias for getSkewness -
var
public double var()Property alias for getVar
-