Class MAP
-
- All Implemented Interfaces:
-
java.io.Serializable
,jline.lang.Copyable
public class MAP extends MarkovModulated implements Serializable
A Markovian Arrival Process
-
-
Method Summary
Modifier and Type Method Description static MAP
rand()
static MAP
rand(int order)
static MAP
randn()
static MAP
randn(int order, double mu, double sigma)
Matrix
D(int i)
Gets the i-th matrix of the Markovian arrival process representation. double
evalCDF(double t)
Evaluates the cumulative distribution function (CDF) at time t. double
evalLST(double s)
Evaluates the Laplace-Stieltjes Transform (LST) at parameter s. double
getMean()
Gets the mean of this Markovian distribution. long
getNumberOfPhases()
Gets the number of phases in this Markovian distribution. MatrixCell
getProcess()
Gets the matrix representation of this Markovian process. double
getRate()
Gets the rate of this distribution (inverse of mean). MatrixCell
getRenewalProcess()
double
getSCV()
Gets the squared coefficient of variation (SCV) of this distribution. double
getSkewness()
Gets the skewness of this distribution. double
getVar()
Gets the variance of this distribution. MAP
toTimeReversed()
double
evalMeanT(double t)
Evaluates the mean of the counting process at time t. double
evalVarT(double t)
Evaluates the variance of the counting process at time t. Matrix
evalACFT(Array<int> lags, double timescale)
Evaluates the autocorrelation function at given lags and timescale. double
evalPDF(double t)
Evaluates the probability density function (PDF) at time t. void
normalize()
Normalizes the MAP so that D0+D1 forms a proper infinitesimal generator. static MAP
fitCentralAndACFDecay(double mean, double var, double skew, double gamma2)
Fit MAP from central moments and autocorrelation function decay. static MAP
fitRawMomentsAndACFDecay(double m1, double m2, double m3, double gamma2)
Fit MAP from raw moments and autocorrelation function decay. String
toString()
Returns a string representation of this MAP process. boolean
equals(Object obj)
Checks if this MAP is equal to another object. int
hashCode()
Returns the hash code for this MAP process. -
Methods inherited from class jline.lang.processes.MarkovModulated
getACFDecay
-
Methods inherited from class jline.lang.processes.Markovian
acf, embedded, embeddedProb, evalCDF, getACF, getEmbedded, getEmbeddedProb, getIDC, getIDI, getInitProb, getMoments, getMu, getPhi, getSubgenerator, 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
-
-
Constructor Detail
-
MAP
MAP(MatrixCell map)
-
MAP
MAP()
-
-
Method Detail
-
D
Matrix D(int i)
Gets the i-th matrix of the Markovian arrival process representation.
- Parameters:
i
- the matrix index (0 for D0, 1 for D1, etc.- Returns:
the matrix at index i
-
evalCDF
double evalCDF(double t)
Evaluates the cumulative distribution function (CDF) at time t. For a MAP, this represents the probability that an inter-arrival time is less than or equal to t.
- Parameters:
t
- the time value- Returns:
the CDF value at time t
-
evalLST
double evalLST(double s)
Evaluates the Laplace-Stieltjes Transform (LST) at parameter s. For a MAP, LST(s) = alpha * (-T + s*I)^(-1) * t where alpha is the initial probability vector, T is the subgenerator, and t is the exit rate vector.
- Parameters:
s
- the transform parameter- Returns:
the LST value at parameter s
-
getMean
double getMean()
Gets the mean of this Markovian distribution.
- Returns:
the mean value, or NaN if the process contains NaN values
-
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
-
getRate
double getRate()
Gets the rate of this distribution (inverse of mean).
- Returns:
the rate value (1/mean)
-
getRenewalProcess
MatrixCell getRenewalProcess()
-
getSCV
double getSCV()
Gets the squared coefficient of variation (SCV) of this distribution. SCV = Var(X) / E[X]^2.
- Returns:
the squared coefficient of variation
-
getSkewness
double getSkewness()
Gets the skewness of this distribution. Skewness measures the asymmetry of the probability distribution.
- Returns:
the skewness value
-
getVar
double getVar()
Gets the variance of this distribution. Computed as SCV * mean^2.
- Returns:
the variance
-
toTimeReversed
MAP toTimeReversed()
-
evalMeanT
double evalMeanT(double t)
Evaluates the mean of the counting process at time t. For MAP, this gives the expected number of arrivals by time t.
- Parameters:
t
- the time value- Returns:
the mean number of arrivals by time t
-
evalVarT
double evalVarT(double t)
Evaluates the variance of the counting process at time t. For MAP, this provides the variance of the number of arrivals by time t.
- Parameters:
t
- the time value- Returns:
the variance of arrivals by time t
-
evalACFT
Matrix evalACFT(Array<int> lags, double timescale)
Evaluates the autocorrelation function at given lags and timescale. For MAP, this measures the correlation between arrivals at different times.
- Parameters:
lags
- array of lag valuestimescale
- the timescale parameter- Returns:
matrix of autocorrelation values
-
evalPDF
double evalPDF(double t)
Evaluates the probability density function (PDF) at time t. For MAP, this is the derivative of the CDF.
- Parameters:
t
- the time value- Returns:
the PDF value at time t
-
normalize
void normalize()
Normalizes the MAP so that D0+D1 forms a proper infinitesimal generator. Each row sum of (D0+D1) should equal zero for a valid generator.
-
fitCentralAndACFDecay
static MAP fitCentralAndACFDecay(double mean, double var, double skew, double gamma2)
Fit MAP from central moments and autocorrelation function decay. This creates a MAP that matches the given statistical properties.
- Parameters:
mean
- the mean inter-arrival timevar
- the variance of inter-arrival timesskew
- the skewness of inter-arrival timesgamma2
- the autocorrelation function decay parameter- Returns:
fitted MAP process
-
fitRawMomentsAndACFDecay
static MAP fitRawMomentsAndACFDecay(double m1, double m2, double m3, double gamma2)
Fit MAP from raw moments and autocorrelation function decay. This is a simplified version that creates a 2-phase MAP.
- Parameters:
m1
- first raw momentm2
- second raw momentm3
- third raw momentgamma2
- autocorrelation function decay parameter- Returns:
fitted MAP process
-
toString
String toString()
Returns a string representation of this MAP process.
- Returns:
string representation showing dimensions and basic properties
-
equals
boolean equals(Object obj)
Checks if this MAP is equal to another object.
- Parameters:
obj
- the object to compare with- Returns:
true if equal, false otherwise
-
hashCode
int hashCode()
Returns the hash code for this MAP process.
- Returns:
hash code based on matrix contents
-
-
-
-