Class RAP
-
- All Implemented Interfaces:
-
java.io.Serializable,jline.lang.Copyable
public class RAP extends Markovian
A Rational Arrival Process (RAP) distribution. RAP is a generalization of the Markovian Arrival Process (MAP) where the matrices H0 and H1 represent hidden and visible transitions respectively, but with relaxed constraints compared to MAP. Representation: - H0: matrix of hidden transition rates (transitions without arrivals) - H1: matrix of visible transition rates (transitions with arrivals) - H0 + H1 must form a valid infinitesimal generator (row sums = 0) - All eigenvalues of H0 must have negative real parts - Dominant eigenvalue of H0 must be negative and real The marginal distribution of inter-arrival times is a Matrix Exponential (ME) distribution.
-
-
Method Summary
Modifier and Type Method Description MatrixgetH0()Gets the H0 matrix (hidden transition rates). MatrixgetH1()Gets the H1 matrix (visible transition rates). longgetNumberOfPhases()Gets the number of phases in this Markovian distribution. MatrixCellgetProcess()Gets the matrix representation of this Markovian process. static RAPfitMomentsAndCorrelations(Array<double> moments, Array<double> correlations)Creates a RAP by fitting the given moments and correlations. static RAPfitMoments(Array<double> moments)Creates a RAP by fitting the given moments. static RAPfromMAP(MAP map)Creates a RAP from a Markovian Arrival Process (MAP). static RAPfromPoisson(double rate)Creates a RAP from an exponential renewal process (Poisson process). static RAPfromErlang(int k, double rate)Creates a RAP from an Erlang renewal process. static RAPfromHyperExp(double p, double lambda1, double lambda2)Creates a RAP from a Hyper-exponential distribution. static RAPfitMeanAndSCV(double mean, double scv)Creates a RAP by fitting the given mean and squared coefficient of variation (SCV). -
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
-
fitMomentsAndCorrelations
static RAP fitMomentsAndCorrelations(Array<double> moments, Array<double> correlations)
Creates a RAP by fitting the given moments and correlations. Uses BuTools RAPFromMomentsAndCorrelations algorithm if available.
- Parameters:
moments- array of momentscorrelations- array of lag-k correlations- Returns:
a RAP matching the given moments and correlations
-
fitMoments
static RAP fitMoments(Array<double> moments)
Creates a RAP by fitting the given moments. Uses BuTools RAPFromMoments algorithm if available.
- Parameters:
moments- array of moments- Returns:
a RAP matching the given moments
-
fromMAP
static RAP fromMAP(MAP map)
Creates a RAP from a Markovian Arrival Process (MAP). This shows that MAP is a special case of RAP.
- Parameters:
map- the MAP to convert to RAP- Returns:
a RAP equivalent to the given MAP
-
fromPoisson
static RAP fromPoisson(double rate)
Creates a RAP from an exponential renewal process (Poisson process).
- Parameters:
rate- the arrival rate (lambda)- Returns:
a RAP representing a Poisson process
-
fromErlang
static RAP fromErlang(int k, double rate)
Creates a RAP from an Erlang renewal process.
- Parameters:
k- number of phasesrate- rate parameter for each phase- Returns:
a RAP representing an Erlang renewal process
-
fromHyperExp
static RAP fromHyperExp(double p, double lambda1, double lambda2)
Creates a RAP from a Hyper-exponential distribution.
- Parameters:
p- probability of using the first phaselambda1- rate parameter for the first phaselambda2- rate parameter for the second phase- Returns:
a RAP representing a Hyper-exponential renewal process
-
fitMeanAndSCV
static RAP fitMeanAndSCV(double mean, double scv)
Creates a RAP by fitting the given mean and squared coefficient of variation (SCV). Uses Erlang fitting for SCV <1 and HyperExp fitting for SCV >= 1.
- Parameters:
mean- target mean inter-arrival timescv- target squared coefficient of variation- Returns:
a RAP matching the given mean and SCV
-
-
-
-