Package jline.lang.processes
Class PH
- All Implemented Interfaces:
Serializable,Copyable
A general phase-type (PH) distribution
- See Also:
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleevalCDF(double t) Evaluates the cumulative distribution function (CDF) at time t.doubleevalLST(double s) Evaluate the Laplace-Stieltjes Transform at sstatic PHfit(double mean, double scv, double skew) Fits a PH from the mean, the squared coefficient of variation and the skewness.static PHfitCentral(double mean, double var, double skew) Fits a PH from the mean, the variance and the skewness.static PHfitMeanAndSCV(double mean, double scv) Fits a PH from the mean and the squared coefficient of variation, taking the minimum-skewness third moment of the acyclic class.static PHfitRawMoments(double m1, double m2, double m3) Fits a PH from the first three raw moments.Gets the initial probability vector.doublegetMean()Gets the mean of this Markovian distribution.longGets the number of phases in this Markovian distribution.Gets the matrix representation of this Markovian process.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.initProb()Property alias for getInitProbdoublemean()Property alias for getMeanlongProperty alias for getNumberOfPhaseslongProperty alias for getNumberOfPhasesprocess()Property alias for getProcessdoublerate()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 getSkewnessProperty alias for getSubgeneratordoublevar()Property alias for getVarMethods inherited from class jline.lang.processes.Markovian
acf, D, embedded, embeddedProb, evalCDF, evalLST, evalMeanT, evalVarT, getACF, getACF, getEmbedded, getEmbeddedProb, getIDC, getIDC, getIDI, getMoments, getMu, getPhi, getRepresentation, getVariance, idc, idi, moments, mu, phi, setMean, setProcess, setRate, 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, withDefect, withMassAtOrigin
-
Constructor Details
-
PH
-
-
Method Details
-
fit
Fits a PH from the mean, the squared coefficient of variation and the skewness.The fit is the acyclic one of
APH.fit(double, double, double), returned as aPH, as in the MATLAB and PythonPH.fit, whose two-state search falls back to the acyclic fitter.- Parameters:
mean- meanscv- squared coefficient of variationskew- skewness- Returns:
- the fitted PH
-
fitCentral
Fits a PH from the mean, the variance and the skewness.- Parameters:
mean- meanvar- varianceskew- skewness- Returns:
- the fitted PH
-
fitMeanAndSCV
Fits a PH from the mean and the squared coefficient of variation, taking the minimum-skewness third moment of the acyclic class.- Parameters:
mean- meanscv- squared coefficient of variation- Returns:
- the fitted PH
-
fitRawMoments
Fits a PH from the first three raw moments.- Parameters:
m1- first momentm2- second momentm3- third moment- Returns:
- the fitted PH
-
evalCDF
public double evalCDF(double t) Evaluates the cumulative distribution function (CDF) at time t. For a PH distribution, CDF(t) = 1 - alpha * exp(T*t) * e where alpha is the initial probability vector, T is the subgenerator, and e is a vector of ones. -
evalLST
public double evalLST(double s) Description copied from class:DistributionEvaluate the Laplace-Stieltjes Transform at s -
getInitProb
Description copied from class:MarkovianGets the initial probability vector.- Overrides:
getInitProbin classMarkovian- Returns:
- the initial probabilities
-
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
-
getProcess
Description copied from class:MarkovianGets the matrix representation of this Markovian process.- Overrides:
getProcessin classMarkovian- Returns:
- MatrixCell containing D0, D1, ... matrices
-
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
-
getSubgenerator
- Overrides:
getSubgeneratorin classMarkovian
-
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) 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. -
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 -
initProb
Property alias for getInitProb -
numberOfPhases
public long numberOfPhases()Property alias for getNumberOfPhases- Overrides:
numberOfPhasesin classMarkovian
-
numPhases
public long numPhases()Property alias for getNumberOfPhases -
process
Property alias for getProcess -
subgenerator
Property alias for getSubgenerator- Overrides:
subgeneratorin classMarkovian
-