Class Exp
-
- All Implemented Interfaces:
-
java.io.Serializable,jline.lang.Copyable
public class Exp extends Markovian implements Serializable
An exponential distribution.
-
-
Constructor Summary
Constructors Constructor Description Exp(double lambda)Creates an exponential distribution with the specified rate parameter.
-
Method Summary
Modifier and Type Method Description static ExpfitMean(double MEAN)Creates an exponential distribution fitted to the specified mean. static ExpfitRate(double RATE)Creates an exponential distribution fitted to the specified rate. 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 exponential distribution. longgetNumberOfPhases()Gets the number of phases in this distribution. doublegetRate()Gets the rate parameter of this exponential distribution. doublegetSCV()Gets the squared coefficient of variation. doublegetSkewness()Gets the skewness of this exponential distribution. doublegetVar()Gets the variance of this exponential distribution. Array<double>sample(int n)Generates random samples from this distribution using default random generator. Array<double>sample(int n, Random rand)Generates random samples from this distribution using the specified random generator. StringtoString()voidupdateRate(double rate)Updates the rate parameter of this exponential distribution. longnumberOfPhases()Kotlin-style property alias for getNumberOfPhases() longnumPhases()Kotlin-style property alias for getNumberOfPhases() 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, getPhi, getProcess, getSubgenerator, getVariance, idc, idi, initProb, moments, mu, 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
-
fitMean
static Exp fitMean(double MEAN)
Creates an exponential distribution fitted to the specified mean.
- Parameters:
MEAN- the desired mean value- Returns:
an exponential distribution with the specified mean
-
fitRate
static Exp fitRate(double RATE)
Creates an exponential distribution fitted to the specified rate.
- Parameters:
RATE- the desired rate value- Returns:
an exponential distribution with the specified rate
-
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 F(t) = 1 - e^(-λ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)
-
getMean
double getMean()
Gets the mean of this exponential distribution.
- Returns:
the mean value (1/λ)
-
getNumberOfPhases
long getNumberOfPhases()
Gets the number of phases in this distribution. Exponential distribution has a single phase.
- Returns:
always returns 1
-
getRate
double getRate()
Gets the rate parameter of this exponential distribution.
- Returns:
the rate parameter λ
-
getSCV
double getSCV()
Gets the squared coefficient of variation. For exponential distribution, SCV = 1.
- Returns:
always returns 1
-
getSkewness
double getSkewness()
Gets the skewness of this exponential distribution.
- Returns:
always returns 2
-
getVar
double getVar()
Gets the variance of this exponential distribution.
- Returns:
the variance (1/λ²)
-
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
-
sample
Array<double> sample(int n, Random rand)
Generates random samples from this distribution using the specified random generator.
- Parameters:
n- the number of samples to generate- Returns:
array of random samples
-
updateRate
void updateRate(double rate)
Updates the rate parameter of this exponential distribution.
- Parameters:
rate- the new rate parameter
-
numberOfPhases
long numberOfPhases()
Kotlin-style property alias for getNumberOfPhases()
-
numPhases
long numPhases()
Kotlin-style property alias for getNumberOfPhases()
-
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()
-
-
-
-