Package jline.lang.processes
Class Exp
java.lang.Object
jline.lang.processes.Distribution
jline.lang.processes.ContinuousDistribution
jline.lang.processes.Markovian
jline.lang.processes.Exp
- All Implemented Interfaces:
Serializable,Copyable
An exponential distribution.
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionExp(double lambda) Creates an exponential distribution with the specified rate parameter. -
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 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.doublegetMean()Gets the mean of this exponential distribution.longGets the number of phases in this distribution.doublegetRate()Gets the rate parameter of this exponential distribution.doublegetSCV()Gets the squared coefficient of variation.doubleGets the skewness of this exponential distribution.doublegetVar()Gets the variance of this exponential distribution.doublemean()Property alias for getMeanlongProperty alias for getNumberOfPhaseslongProperty alias for getNumberOfPhasesdoublerate()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 getSCVvoidsetMean(double newMean) Sets the mean by rescaling the process AND the rate parameter.doubleskewness()Property alias for getSkewnesstoString()voidupdateRate(double rate) Updates the rate parameter of this exponential distribution.doublevar()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, getPhi, getProcess, getSubgenerator, getVariance, idc, idi, initProb, moments, mu, phi, process, 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
-
Exp
public Exp(double lambda) Creates an exponential distribution with the specified rate parameter.- Parameters:
lambda- the rate parameter (must be positive)
-
-
Method Details
-
fitMean
Creates an exponential distribution fitted to the specified mean.- Parameters:
MEAN- the desired mean value- Returns:
- an exponential distribution with the specified mean
-
fitRate
Creates an exponential distribution fitted to the specified rate.- Parameters:
RATE- the desired rate value- Returns:
- an exponential distribution with the specified rate
-
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. -
setMean
public void setMean(double newMean) Sets the mean by rescaling the process AND the rate parameter. Markovian.setMean rewrites the MAP representation only, but getRate, getMean, evalCDF, evalLST and Network.refreshStruct all read the rate parameter, so a rescaled Exp would otherwise keep reporting its old rate and every estimator's model update would be silently lost. -
getMean
public double getMean()Gets the mean of this exponential distribution. -
getNumberOfPhases
public long getNumberOfPhases()Gets the number of phases in this distribution. Exponential distribution has a single phase.- Overrides:
getNumberOfPhasesin classMarkovian- Returns:
- always returns 1
-
getRate
public double getRate()Gets the rate parameter of this exponential distribution. -
getSCV
public double getSCV()Gets the squared coefficient of variation. For exponential distribution, SCV = 1. -
getSkewness
public double getSkewness()Gets the skewness of this exponential distribution.- Overrides:
getSkewnessin classMarkovian- Returns:
- always returns 2
-
getVar
public double getVar()Gets the variance of this exponential distribution. -
sample
public double[] sample(int n) Description copied from class:DistributionGenerates random samples from this distribution using default random generator. -
sample
Description copied from class:DistributionGenerates random samples from this distribution using the specified random generator. -
toString
-
updateRate
public void updateRate(double rate) Updates the rate parameter of this exponential distribution.- Parameters:
rate- the new rate parameter
-
numberOfPhases
public long numberOfPhases()Property alias for getNumberOfPhases- Overrides:
numberOfPhasesin classMarkovian
-
numPhases
public long numPhases()Property alias for getNumberOfPhases -
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
-