Class MMPP2
-
- All Implemented Interfaces:
-
java.io.Serializable,jline.lang.Copyable
public class MMPP2 extends MarkovModulated implements Serializable
A Markovian-modulated Poisson Process with 2 states
-
-
Constructor Summary
Constructors Constructor Description MMPP2(double lambda0, double lambda1, double sigma0, double sigma1)
-
Method Summary
Modifier and Type Method Description static MMPP2fitCentralAndACFDecay(double mean, double var, double skew, double g2)static MMPP2fitCentralAndACFLag1(double mean, double var, double skew, double acf1)static MMPP2fitCentralAndIDC(double mean, double var, double skew, double idc)static MMPP2fitRawMomentsAndACFDecay(double m1, double m2, double m3, double gamma2)static MMPP2fitRawMomentsAndACFLag1(double m1, double m2, double m3, double rho1)static MMPP2fitRawMomentsAndIDC(double m1, double m2, double m3, double idc)static MMPP2rand()MatrixD(int i)Gets the i-th matrix of the Markovian arrival process representation. MatrixevalACFT(Array<int> lags, double timescale)doubleevalCDF(double t)Evaluates the cumulative distribution function (CDF) at time t. doubleevalLST(double s)Evaluates the Laplace-Stieltjes Transform (LST) at parameter s. doubleevalMeanT(double t)Evaluates the mean count at time t. doublegetACFDecay(Matrix lags)MatrixgetEmbedded()Gets the embedded Markov chain transition matrix. MatrixgetEmbeddedProb()Gets the stationary probability vector of the embedded Markov chain. doublegetIDC()Gets the index of dispersion for counts (IDC). doublegetIDI()Gets the index of dispersion for intervals (IDI). doublegetMean()Gets the mean of this Markovian distribution. longgetNumberOfPhases()Gets the number of phases in this Markovian distribution. doublegetRate()Gets the rate of this distribution (inverse of mean). doublegetSCV()Gets the squared coefficient of variation (SCV) of this distribution. doublegetSkewness()Gets the skewness of this distribution. doublegetVar()Gets the variance of this distribution. voidnormalize()Normalizes the MMPP2 so that D0+D1 rows form a proper infinitesimal generator. Array<double>sample(int n)Generates random samples from this distribution using default random generator. Array<double>sample(int n, Random random)Generates random samples from this distribution using the specified random generator. MAPtoTimeReversed()doubleevalPDF(double t)Evaluates the probability density function (PDF) at time t. doubleevalVarT(double t)Evaluates the variance at time t. StringtoString()Returns a string representation of this MMPP2 process. booleanequals(Object obj)Checks if this MMPP2 is equal to another object. inthashCode()Returns the hash code for this MMPP2 process. -
Methods inherited from class jline.lang.processes.MarkovModulated
getACFDecay -
Methods inherited from class jline.lang.processes.Markovian
acf, embedded, embeddedProb, evalCDF, getACF, getInitProb, getMoments, getMu, getPhi, getProcess, getSubgenerator, getVariance, idc, idi, initProb, mean, moments, mu, numPhases, numberOfPhases, phi, process, rate, 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
-
fitCentralAndACFDecay
static MMPP2 fitCentralAndACFDecay(double mean, double var, double skew, double g2)
-
fitCentralAndACFLag1
static MMPP2 fitCentralAndACFLag1(double mean, double var, double skew, double acf1)
-
fitCentralAndIDC
static MMPP2 fitCentralAndIDC(double mean, double var, double skew, double idc)
-
fitRawMomentsAndACFDecay
static MMPP2 fitRawMomentsAndACFDecay(double m1, double m2, double m3, double gamma2)
-
fitRawMomentsAndACFLag1
static MMPP2 fitRawMomentsAndACFLag1(double m1, double m2, double m3, double rho1)
-
fitRawMomentsAndIDC
static MMPP2 fitRawMomentsAndIDC(double m1, double m2, double m3, double idc)
-
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 MMPP2, 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 MMPP2, LST(s) = alpha * (-T + s*I)^(-1) * t
- Parameters:
s- the transform parameter- Returns:
the LST value at parameter s
-
evalMeanT
double evalMeanT(double t)
Evaluates the mean count at time t.
- Parameters:
t- the time point- Returns:
the mean count at time t
-
getACFDecay
double getACFDecay(Matrix lags)
-
getEmbedded
Matrix getEmbedded()
Gets the embedded Markov chain transition matrix.
- Returns:
the embedded chain matrix
-
getEmbeddedProb
Matrix getEmbeddedProb()
Gets the stationary probability vector of the embedded Markov chain.
- Returns:
the embedded chain stationary probabilities
-
getIDC
double getIDC()
Gets the index of dispersion for counts (IDC).
- Returns:
the IDC value
-
getIDI
double getIDI()
Gets the index of dispersion for intervals (IDI). For renewal processes, IDI = IDC.
- Returns:
the IDI value
-
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
-
getRate
double getRate()
Gets the rate of this distribution (inverse of mean).
- Returns:
the rate value (1/mean)
-
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
-
normalize
void normalize()
Normalizes the MMPP2 so that D0+D1 rows form a proper infinitesimal generator. Each row sum of (D0+D1) should equal zero for a valid generator.
-
sample
Array<double> sample(int n)
Generates random samples from this distribution using default random generator.
- Parameters:
n- the number of samples to generate- Returns:
array of random samples
-
sample
Array<double> sample(int n, Random random)
Generates random samples from this distribution using the specified random generator.
- Parameters:
n- the number of samples to generaterandom- the random number generator to use- Returns:
array of random samples
-
toTimeReversed
MAP toTimeReversed()
-
evalPDF
double evalPDF(double t)
Evaluates the probability density function (PDF) at time t. For MMPP2, this is the derivative of the CDF.
- Parameters:
t- the time value- Returns:
the PDF value at time t
-
evalVarT
double evalVarT(double t)
Evaluates the variance at time t. For MMPP2, this provides the variance of the counting process at time t.
- Parameters:
t- the time value- Returns:
the variance at time t
-
toString
String toString()
Returns a string representation of this MMPP2 process.
- Returns:
string representation showing parameters
-
equals
boolean equals(Object obj)
Checks if this MMPP2 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 MMPP2 process.
- Returns:
hash code based on parameters
-
-
-
-