Package jline.lang.processes
Class HyperExp
java.lang.Object
jline.lang.processes.Distribution
jline.lang.processes.ContinuousDistribution
jline.lang.processes.Markovian
jline.lang.processes.HyperExp
- All Implemented Interfaces:
Serializable,Copyable
A hyper-exponential distribution.
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionHyperExp(double[] p, double[] lambda) Creates an n-phase hyper-exponential distribution: with probability p[i] the sample is exponential with rate lambda[i].HyperExp(double p, double lambda) HyperExp(double p, double lambda1, double lambda2) Creates an n-phase hyper-exponential distribution from Matrix vectors. -
Method Summary
Modifier and TypeMethodDescriptiondoubleevalCDF(double t) Evaluates the cumulative distribution function at the given point.doubleevalLST(double s) Evaluate the Laplace-Stieltjes Transform at sstatic HyperExpfit(ContinuousDistribution dist, String method) Fit a hyperexponential to the ccdf ofdistITSELF at points spread over decades of time scale, rather than to its moments (HyperexpFitLongtail, Feldmann and Whitt 1998).static HyperExpfitMeanAndSCV(double mean, double scv) static HyperExpfitMeanAndSCVBalanced(double mean, double scv) Fit distribution with given squared coefficient of variation and balanced means i.e., p/mu1 = (1-p)/mu2double[]Gets the phase rates, one per phase.doublegetMean()Gets the mean of this Markovian distribution.longGets the number of phases in this Markovian distribution.double[]getP()Gets the branch probabilities, one per phase.doublegetRate()Gets the rate of this distribution (inverse of mean).doublegetSCV()Gets the squared coefficient of variation (SCV) of this distribution.doubleGets the skewness of this distribution.doublegetVar()Gets the variance of this distribution.doublemean()Property alias for getMeanlongProperty alias for getNumberOfPhaseslongProperty alias for getNumberOfPhasesdoublerate()Property alias for getRatedouble[]sample(int n) Gets n samples from the distributiondouble[]Generates random samples from this distribution using the specified random generator.doublescv()Property alias for getSCVdoubleskewness()Property alias for getSkewnesstoString()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, 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
-
HyperExp
public HyperExp(double p, double lambda1, double lambda2) -
HyperExp
public HyperExp(double p, double lambda) -
HyperExp
public HyperExp(double[] p, double[] lambda) Creates an n-phase hyper-exponential distribution: with probability p[i] the sample is exponential with rate lambda[i].This mirrors the MATLAB HyperExp representation exactly: D0 = -diag(lambda), D1 = -D0*p(:)*ones(1,n), i.e. D1(i,j) = lambda(i)*p(j). For n = 2 this coincides with the (p, lambda1, lambda2) constructor.
- Parameters:
p- branch probabilities, one per phase (must sum to 1)lambda- phase rates, one per phase
-
HyperExp
Creates an n-phase hyper-exponential distribution from Matrix vectors.- Parameters:
p- branch probabilities, one per phase (must sum to 1)lambda- phase rates, one per phase
-
-
Method Details
-
getP
public double[] getP()Gets the branch probabilities, one per phase.- Returns:
- a copy of the branch probability vector
-
getLambda
public double[] getLambda()Gets the phase rates, one per phase.- Returns:
- a copy of the rate vector
-
fit
Fit a hyperexponential to the ccdf ofdistITSELF at points spread over decades of time scale, rather than to its moments (HyperexpFitLongtail, Feldmann and Whitt 1998).That is the only form available for a long-tail law: a Pareto with tail index below 2 has no finite variance, so the moment fits above do not exist at all, and even where the moments are finite they say nothing about the orders of magnitude over which such a law acts.
- Parameters:
dist- the law to approximatemethod- the fitting method; only"feldmannwhitt"is defined here- Returns:
- the fitted hyperexponential
-
fitMeanAndSCV
-
fitMeanAndSCVBalanced
Fit distribution with given squared coefficient of variation and balanced means i.e., p/mu1 = (1-p)/mu2 -
evalCDF
public double evalCDF(double t) Description copied from class:MarkovianEvaluates the cumulative distribution function at the given point. -
evalLST
public double evalLST(double s) Description copied from class:DistributionEvaluate the Laplace-Stieltjes Transform at s -
getMean
public double getMean()Description copied from class:MarkovianGets the mean of this Markovian distribution. -
getNumberOfPhases
public long getNumberOfPhases()Description copied from class:MarkovianGets the number of phases in this Markovian distribution.- Overrides:
getNumberOfPhasesin classMarkovian- Returns:
- the number of phases
-
getRate
public double getRate()Description copied from class:DistributionGets the rate of this distribution (inverse of mean). -
getSCV
public double getSCV()Description copied from class:DistributionGets the squared coefficient of variation (SCV) of this distribution. SCV = Var(X) / E[X]^2. -
getSkewness
public double getSkewness()Description copied from class:DistributionGets the skewness of this distribution. Skewness measures the asymmetry of the probability distribution.- Overrides:
getSkewnessin classMarkovian- Returns:
- the skewness value
-
getVar
public double getVar()Description copied from class:DistributionGets the variance of this distribution. Computed as SCV * mean^2. -
sample
public double[] sample(int n) Gets n samples from the distribution -
sample
Description copied from class:DistributionGenerates random samples from this distribution using the specified random generator. -
toString
-
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 -
numberOfPhases
public long numberOfPhases()Property alias for getNumberOfPhases- Overrides:
numberOfPhasesin classMarkovian
-
numPhases
public long numPhases()Property alias for getNumberOfPhases
-