Class ME
-
- All Implemented Interfaces:
-
java.io.Serializable,jline.lang.Copyable
public class ME extends Markovian
A Matrix Exponential (ME) distribution. ME distributions are characterized by an initial vector alpha and a matrix parameter A. They generalize Phase-Type (PH) distributions by allowing alpha to have entries outside [0,1] and A to have arbitrary structure (not necessarily a valid sub-generator). Representation: - alpha: initial vector (may have negative entries or sum != 1) - A: matrix parameter (must have all eigenvalues with negative real parts) - Dominant eigenvalue of A must be negative and real The distribution function is: F(t) = 1 - alpha * exp(A*t) * e (under certain conditions) Moments: m_k = k! * alpha * (-A)^(-k) * e
-
-
Method Summary
Modifier and Type Method Description MatrixgetAlpha()Gets the initial vector alpha. MatrixgetA()Gets the matrix parameter A. longgetNumberOfPhases()Gets the number of phases in this Markovian distribution. MatrixCellgetProcess()Gets the matrix representation of this Markovian process. static MEfitMoments(Array<double> moments)Creates an ME distribution by fitting the given moments. static MEfromExp(double rate)Creates an ME distribution from an exponential distribution. static MEfromErlang(int k, double rate)Creates an ME distribution from an Erlang distribution. static MEfromHyperExp(Array<double> p, Array<double> rates)Creates an ME distribution from a HyperExponential distribution. -
Methods inherited from class jline.lang.processes.Markovian
D, acf, embedded, embeddedProb, evalCDF, evalCDF, evalLST, evalMeanT, evalVarT, getACF, getEmbedded, getEmbeddedProb, getIDC, getIDI, getInitProb, getMean, getMoments, getMu, getPhi, getRate, getSCV, getSkewness, getSubgenerator, getVar, getVariance, idc, idi, initProb, mean, moments, mu, numPhases, numberOfPhases, phi, process, rate, sample, sample, scv, setMean, setProcess, setRate, skewness, subgenerator, var, 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
-
getNumberOfPhases
long getNumberOfPhases()
Gets the number of phases in this Markovian distribution.
- Returns:
the number of phases
-
getProcess
MatrixCell getProcess()
Gets the matrix representation of this Markovian process.
- Returns:
MatrixCell containing D0, D1, ... matrices
-
fitMoments
static ME fitMoments(Array<double> moments)
Creates an ME distribution by fitting the given moments. Uses BuTools MEFromMoments algorithm.
- Parameters:
moments- array of moments (requires 2*M-1 moments for order M ME distribution)- Returns:
an ME distribution matching the given moments
-
fromExp
static ME fromExp(double rate)
Creates an ME distribution from an exponential distribution. This is a convenience method showing that Exp is a special case of ME.
- Parameters:
rate- the rate parameter (lambda)- Returns:
an ME distribution equivalent to Exp(rate)
-
fromErlang
static ME fromErlang(int k, double rate)
Creates an ME distribution from an Erlang distribution. This is a convenience method showing that Erlang is a special case of ME.
- Parameters:
k- number of phasesrate- rate parameter for each phase- Returns:
an ME distribution equivalent to Erlang(k, rate)
-
fromHyperExp
static ME fromHyperExp(Array<double> p, Array<double> rates)
Creates an ME distribution from a HyperExponential distribution. This is a convenience method showing that HyperExp is a special case of ME.
- Parameters:
p- array of probabilities for each branchrates- array of rates for each branch- Returns:
an ME distribution equivalent to HyperExp(p, rates)
-
-
-
-