Package jline.lang.processes
Class RAP
java.lang.Object
jline.lang.processes.Distribution
jline.lang.processes.ContinuousDistribution
jline.lang.processes.Markovian
jline.lang.processes.RAP
- All Implemented Interfaces:
Serializable,Copyable
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.
- See Also:
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic RAPfitMeanAndSCV(double mean, double scv) Creates a RAP by fitting the given mean and squared coefficient of variation (SCV).static RAPfitMoments(double[] moments) Creates a RAP by fitting the given moments.static RAPfitMomentsAndCorrelations(double[] moments, double[] correlations) Creates a RAP by fitting the given moments and correlations.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 RAPCreates a RAP from a Markovian Arrival Process (MAP).static RAPfromPoisson(double rate) Creates a RAP from an exponential renewal process (Poisson process).getH0()Gets the H0 matrix (hidden transition rates).getH1()Gets the H1 matrix (visible transition rates).longGets the number of phases in this Markovian distribution.Gets the matrix representation of this Markovian process.Methods inherited from class jline.lang.processes.Markovian
acf, D, 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, numberOfPhases, numPhases, phi, process, rate, sample, sample, scv, setMean, setProcess, setRate, skewness, subgenerator, var, varianceMethods inherited from class jline.lang.processes.Distribution
evalProbInterval, getName, getNumParams, getParam, getSupport, isContinuous, isDisabled, isDiscrete, isImmediate, isMarkovian, name, numParams, param, setNumParams, setParam, support
-
Constructor Details
-
RAP
Creates a Rational Arrival Process with specified H0 and H1 matrices.- Parameters:
H0- matrix of hidden transition rates (square matrix)H1- matrix of visible transition rates (square matrix, same size as H0)- Throws:
IllegalArgumentException- if the representation is invalid
-
-
Method Details
-
getH0
Gets the H0 matrix (hidden transition rates).- Returns:
- the H0 matrix
-
getH1
Gets the H1 matrix (visible transition rates).- Returns:
- the H1 matrix
-
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
-
fitMomentsAndCorrelations
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
- Throws:
UnsupportedOperationException- if fitting algorithm is not yet implemented
-
fitMoments
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
- Throws:
UnsupportedOperationException- if fitting algorithm is not yet implemented
-
fromMAP
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
Creates a RAP from an exponential renewal process (Poisson process).- Parameters:
rate- the arrival rate (lambda)- Returns:
- a RAP representing a Poisson process
-
fromErlang
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
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
Creates a RAP by fitting the given mean and squared coefficient of variation (SCV). Uses Erlang fitting for SCV invalid input: '<' 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
-