Class MAM
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic MatrixCell
aph_fit
(double e1, double e2, double e3) Fits an acyclic phase-type (APH) distribution to the given moments of a random variable.static MatrixCell
aph_fit
(double e1, double e2, double e3, int nmax) Fits an acyclic phase-type (APH) distribution to the given moments of a random variable.aph2_adjust
(double M1, double M2, double M3) Adjusts the second and third moments (M2 and M3) of a distribution using the default "simple" method for fitting an APH(2) distribution.aph2_adjust
(double M1, double M2, double M3, String method) Adjusts the second and third moments (M2 and M3) of a distribution for fitting an APH(2) distribution.static MatrixCell
aph2_assemble
(double l1, double l2, double p1) Assembles an acyclic phase-type (APH) distribution with two phases (APH(2)) using the given parameters.static Ret.mamAPH2Fit
aph2_fit
(double M1, double M2, double M3) Fits an acyclic phase-type (APH) distribution with two phases (APH(2)) to match the given moments of a random variable.static Map<Integer,
MatrixCell> aph2_fitall
(double M1, double M2, double M3) Fits a set of acyclic phase-type (APH) distributions with two phases (APH(2)) to match the given moments of a random variable.static MatrixCell
static Matrix
map_acf
(MatrixCell MAP) Computes the autocorrelation function (ACF) for a given MAP using a default lag of 1.static Matrix
map_acf
(MatrixCell MAP, Matrix lags) Computes the autocorrelation function (ACF) for a given MAP at multiple lags using a MatrixCell.static Matrix
Computes the autocorrelation function (ACF) for a given MAP using a default lag of 1.static Matrix
Computes the autocorrelation function (ACF) for a given MAP at a specific lag.static Matrix
Computes the autocorrelation function (ACF) for a given MAP at multiple lags.static double[]
map_acfc
(MatrixCell MAP, int[] lags, double u) Computes the autocorrelation function coefficients (ACFC) for a MAP counting process using a MatrixCell.static double[]
Computes the autocorrelation function coefficients (ACFC) for a MAP counting process.static Matrix
map_cdf
(MatrixCell MAP, Matrix points) Computes the cumulative distribution function (CDF) of the inter-arrival times of a MAP stored in a MatrixCell that contains the MAP's transition matrices.static Matrix
Computes the cumulative distribution function (CDF) of the inter-arrival times of a Markovian Arrival Process (MAP).static boolean
map_checkfeasible
(MatrixCell MAP, double TOL) Placeholder method to check the feasibility of a MAP.double
map_count_mean
(MatrixCell MAP, double t) Computes the mean of the counting process over a specified interval length for a given Markovian Arrival Process (MAP).double[]
map_count_mean
(MatrixCell MAP, double[] t) Computes the mean of the counting process over multiple specified interval lengths for a given Markovian Arrival Process (MAP).double
map_count_var
(MatrixCell MAP, double t) Computes the variance of the counting process over a specified interval length for a given Markovian Arrival Process (MAP).double[]
map_count_var
(MatrixCell MAP, double[] t) Computes the variance of the counting process over multiple specified interval lengths for a given Markovian Arrival Process (MAP).static Matrix
map_embedded
(MatrixCell MAP) Computes the embedded discrete-time Markov chain (DTMC) matrix of a MAP given as a MatrixCell.static Matrix
map_embedded
(Matrix D0, Matrix D1) Computes the embedded discrete-time Markov chain (DTMC) matrix of a MAP.static MatrixCell
map_erlang
(double mean, int k) Fits an Erlang-k process as a Markovian Arrival Process (MAP).static MatrixCell
map_exponential
(double mean) Creates a Markovian Arrival Process (MAP) with an exponential inter-arrival time distribution.static int
Returns the feasibility tolerance for MAPs.static double
map_gamma
(MatrixCell MAP) Computes the gamma parameter for a MAP using a MatrixCell.static double
Computes the gamma parameter for a MAP, which is the ratio of the ACF values at lag 2 and lag 1.static double[]
map_gamma2
(MatrixCell MAP) Returns the largest non-unit eigenvalue (both real and imaginary parts) of the embedded Discrete-Time Markov Chain (DTMC) of a given Markovian Arrival Process (MAP).static MatrixCell
map_hyperexp
(double mean, double scv, double p) Fit a two-phase Hyper-exponential renewal process as a MAPstatic double
map_idc
(MatrixCell MAP) Computes the asymptotic index of dispersion (IDC) for a MAP stored in a MatrixCell that contains the MAP's transition matrices.static double
Computes the asymptotic index of dispersion (IDC) for a Markovian Arrival Process (MAP).static Matrix
map_infgen
(MatrixCell MAP) Computes the infinitesimal generator matrix (Q) of the Continuous-Time Markov Chain (CTMC) underlying a Markovian Arrival Process (MAP).static Matrix
map_infgen
(Matrix D0, Matrix D1) Computes the infinitesimal generator matrix (Q) of the Continuous-Time Markov Chain (CTMC) underlying a Markovian Arrival Process (MAP).static boolean
map_isfeasible
(MatrixCell MAP) Checks if the provided MAP is feasible using a default tolerance.static boolean
map_isfeasible
(MatrixCell MAP, double TOL) Checks if the provided MAP is feasible based on the given tolerance.static double
map_lambda
(MatrixCell MAP) Computes the arrival rate (lambda) of a Markovian Arrival Process (MAP) using matrices stored in a MatrixCell.static double
map_lambda
(Matrix D0, Matrix D1) Computes the arrival rate (lambda) of a Markovian Arrival Process (MAP).static int
Returns the maximum size considered for large MAPs.static MatrixCell
map_mark
(MatrixCell MAP, Matrix prob) Creates a Marked Markovian Arrival Process (MMAP) by marking a given Markovian Arrival Process (MAP) with additional phases based on specified marking probabilities.static double
map_mean
(MatrixCell MAP) Computes the mean inter-arrival time of a Markovian Arrival Process (MAP) using matrices stored in a MatrixCell.static double
Computes the mean inter-arrival time of a Markovian Arrival Process (MAP).static double
map_moment
(MatrixCell MAP, int order) Computes the raw moments of the inter-arrival times of a MAP stored in a MatrixCell that contains the MAP's transition matrices.static double
map_moment
(Matrix D0, Matrix D1, int order) Computes the raw moments of the inter-arrival times of a Markovian Arrival Process (MAP).static MatrixCell
map_normalize
(MatrixCell MAP) Sanitizes the (D0, D1) matrices of a Markovian Arrival Process (MAP) stored in a MatrixCell.static MatrixCell
map_normalize
(Matrix D0, Matrix D1) Sanitizes the (D0, D1) matrices of a Markovian Arrival Process (MAP) by ensuring all elements are non-negative and adjusting diagonal elements.static Matrix
map_pie
(MatrixCell MAP) Computes the steady-state probability vector of the embedded DTMC of a MAP stored in a MatrixCell that contains the MAP's transition matrices.static Matrix
Computes the steady-state probability vector of the embedded Discrete Time Markov Chain (DTMC) associated with a Markovian Arrival Process (MAP).static Matrix
map_piq
(MatrixCell MAP) Computes the steady-state vector (pi) of the Continuous-Time Markov Chain (CTMC) underlying a Markovian Arrival Process (MAP).static Matrix
Computes the steady-state vector (pi) of the Continuous-Time Markov Chain (CTMC) underlying a Markovian Arrival Process (MAP).map_rand()
Generates a random Markovian Arrival Process (MAP) with 2 states.static MatrixCell
map_rand
(int K) Generates a random Markovian Arrival Process (MAP) with K states.Generates a random Markovian Arrival Process (MAP) with 2 states using normal distribution with mean 1 and standard deviation 2.static MatrixCell
map_randn
(int K, double mu, double sigma) Generates a random Markovian Arrival Process (MAP) with K states using normal distribution.static double[]
map_sample
(MatrixCell MAP, long n, Random random) Generates samples of inter-arrival times from a MAP using a specified number of samples and a random generator.static double[]
map_sample
(Matrix D0, Matrix D1, long n, Random random) Generates samples of inter-arrival times from a MAP using a specified number of samples and a random generator.static MatrixCell
map_scale
(MatrixCell MAP, double newMean) Rescales the mean inter-arrival time of a MAP stored in a MatrixCell that contains the MAP's transition matrices.static MatrixCell
Rescales the mean inter-arrival time of a Markovian Arrival Process (MAP) to a specified new mean.static double
map_scv
(MatrixCell MAP) Computes the squared coefficient of variation (SCV) of the inter-arrival times of a MAP stored in a MatrixCell that contains the MAP's transition matrices.static double
Computes the squared coefficient of variation (SCV) of the inter-arrival times of a Markovian Arrival Process (MAP).static double
map_skew
(MatrixCell MAP) Computes the skewness of the inter-arrival times for a MAP using a MatrixCell.static double
Computes the skewness of the inter-arrival times for a MAP.static MatrixCell
map_sum
(MatrixCell MAP, int n) Computes the Markovian Arrival Process (MAP) representing the sum of `n` identical MAPs.static MatrixCell
map_sumind
(MatrixCell[] MAPs) Computes the Markovian Arrival Process (MAP) representing the sum of `n` independent MAPs.static MatrixCell
map_super
(MatrixCell MAPa, MatrixCell MAPb) Creates a superposition of two Markovian Arrival Processes (MAPs) to form a new MAP.static MatrixCell
Computes the time-reversed MAP of a given MAP.static double
map_var
(MatrixCell MAP) Computes the variance of the inter-arrival times for a MAP using a MatrixCell.static double
Computes the variance of the inter-arrival times for a MAP.static double
map_varcount
(MatrixCell MAP, double t) Computes the variance of the counts in a MAP over a time period t using a MatrixCell.static Matrix
map_varcount
(MatrixCell MAP, Matrix t) Computes the variance of the counts in a MAP over multiple time periods using a MatrixCell.static double
map_varcount
(Matrix D0, Matrix D1, double t) Computes the variance of the counts in a MAP over a time period t.static Matrix
map_varcount
(Matrix D0, Matrix D1, Matrix t) Computes the variance of the counts in a MAP over multiple time periods.static Ret.mamMAPFitReturn
map2_fit
(double e1, double e2, double e3) Fits a 2-phase Markovian Arrival Process (MAP2) using the first three moments.static Ret.mamMAPFitReturn
map2_fit
(double e1, double e2, double e3, double g2) Fits a 2-phase Markovian Arrival Process (MAP2) to match the given moments and decay rate of the autocorrelation function.static Matrix
mmap_backward_moment
(MatrixCell MMAP, Matrix ORDERS) Computes the backward moments of an MMAP for specified orders with normalization.static Matrix
mmap_backward_moment
(MatrixCell MMAP, Matrix ORDERS, int NORM) Computes the backward moments of an MMAP for specified orders.static MatrixCell
mmap_compress
(MatrixCell MMAP) Compresses a Markovian Arrival Process with marked arrivals (MMAP) as a mixture of 2-state acyclic Markovian Arrival Processes (MAPs).static MatrixCell
mmap_compress
(MatrixCell MMAP, SolverOptions config) Compresses a Markovian Arrival Process with marked arrivals (MMAP) based on the provided configuration options.static Matrix
mmap_count_idc
(MatrixCell MMAP, double t) Computes the index of dispersion for counts (IDC) for a Markovian Arrival Process with marked arrivals (MMAP) over a time period.static Matrix
mmap_count_lambda
(MatrixCell mmap) Computes the arrival rate vector of the counting process for the given Marked MAP (MMAP).static Matrix
mmap_count_mean
(MatrixCell MMAP, double t) Computes the mean count vector of events of different types in a Markovian Arrival Process with marked arrivals (MMAP) over a time period.static Matrix
mmap_count_var
(MatrixCell MMAP, double t) Computes the variance of the count vector of events of different types in a Markovian Arrival Process with marked arrivals (MMAP) over a time period.static Matrix
mmap_cross_moment
(MatrixCell mmap, int k) Computes the k-th cross-moment matrix for a given MMAP.static MatrixCell
mmap_exponential
(Matrix lambda) Fits a Markovian Arrival Process with marked arrivals (MMAP) with a single state based on the given arrival rates for each job class.static MatrixCell
mmap_exponential
(Matrix lambda, int n) Fits an order-n Markovian Arrival Process with marked arrivals (MMAP) based on the given arrival rates for each job class.static Matrix
mmap_forward_moment
(MatrixCell MMAP, Matrix ORDERS) Computes the forward moments of an MMAP for specified orders with normalization.static Matrix
mmap_forward_moment
(MatrixCell MMAP, Matrix ORDERS, int NORM) Computes the forward moments of an MMAP for specified orders.static MatrixCell
mmap_hide
(MatrixCell MMAP, Matrix types) Hides specified types of arrivals in a Markovian Arrival Process with marked arrivals (MMAP).static Matrix
mmap_idc
(MatrixCell MMAP) Computes the asymptotic index of dispersion for counts (IDC) for a Markovian Arrival Process with marked arrivals (MMAP).static boolean
mmap_isfeasible
(MatrixCell MMAP) Checks the feasibility of a Markovian Arrival Process with marked arrivals (MMAP).static Matrix
mmap_lambda
(MatrixCell MMAP) Alias for mmap_count_lambda.static Map<Integer,
MatrixCell> mmap_maps
(MatrixCell MMAP) Extracts K Markovian Arrival Processes (MAPs) from a given MMAP, one for each class.static MatrixCell
mmap_mark
(MatrixCell MMAP, Matrix prob) Converts a Markovian Arrival Process with marked arrivals (MMAP) into a new MMAP with redefined classes based on a given probability matrix.static MatrixCell
mmap_mixture
(Matrix alpha, Map<Integer, MatrixCell> MAPs) Creates a mixture of MMAPs using the given weights (alpha) and MAPs.static Ret.mamMMAPMixtureFit
Fits a mixture of Markovian Arrival Processes (MMAPs) to match the given cross-moments.static Ret.mamMMAPMixtureFit
Fits a mixture of Markovian Arrival Processes (MMAPs) to match the given moments.static MatrixCell
mmap_normalize
(MatrixCell MMAP) Normalizes a Markovian Arrival Process with marked arrivals (MMAP) to ensure feasibility.static Matrix
mmap_pc
(MatrixCell MMAP) Computes the proportion of counts (PC) for each type in a Markovian Arrival Process with marked arrivals (MMAP).static MatrixCell
mmap_rand
(int order, int classes) Generates a random MMAP (Marked Markovian Arrival Process) with a given order and number of classes.static Ret.mamMMAPSample
mmap_sample
(MatrixCell MMAP, long n) Generates samples of inter-arrival times and event types from a MMAP using a specified number of samples.static Ret.mamMMAPSample
mmap_sample
(MatrixCell MMAP, long n, Random random) Generates samples of inter-arrival times and event types from a MMAP using a specified number of samples and a random generator.static MatrixCell
mmap_scale
(MatrixCell MMAP, Matrix M) Changes the mean inter-arrival time of a Markovian Arrival Process with marked arrivals (MMAP).static MatrixCell
mmap_shorten
(MatrixCell mmap) Converts an MMAP representation from M3A format to BUTools format.mmap_sigma2
(MatrixCell mmap) Computes the second-order sigma values (covariances) for a given MMAP.static MatrixCell
mmap_super
(MatrixCell MMAPa) Combines a list of MMAPs into one superposed MMAP.static MatrixCell
mmap_super
(MatrixCell MMAPa, MatrixCell MMAPb) Combines two MMAPs into one superposed MMAP using the default option.static MatrixCell
mmap_super
(MatrixCell MMAPa, MatrixCell MMAPb, String opt) Combines two MMAPs into one superposed MMAP.static MatrixCell
mmap_super_safe
(Map<Integer, MatrixCell> MMAPS, int maxorder) Safely combines multiple MMAPs into a single superposed MMAP using the default method, while considering order constraints.static MatrixCell
mmap_super_safe
(Map<Integer, MatrixCell> MMAPS, int maxorder, String method) Safely combines multiple MMAPs into a single superposed MMAP while considering order constraints.static MatrixCell
mmap_timereverse
(MatrixCell mmap) Computes the time-reversed version of a Markovian Arrival Process with marked arrivals (MMAP).static MatrixCell
mmpp2_fit
(double E1, double E2, double E3, double G2) Fits a 2-phase Markovian Arrival Process (MMPP2) to match the given first three moments and a fourth parameter G2.static double
mmpp2_fit_mu00
(double E1, double E2, double E3, double G2) static double
mmpp2_fit_mu11
(double E1, double E2, double E3, double G2) static double
mmpp2_fit_q01
(double E1, double E2, double E3, double G2) static double
mmpp2_fit_q10
(double E1, double E2, double E3, double G2) static MatrixCell
mmpp2_fit1
(double mean, double scv, double skew, double idc) Fits a 2-phase Markov Modulated Poisson Process (MMPP2) based on the specified parameters.static Map<Integer,
Map<Integer, MatrixCell>> ph_reindex
(Map<Station, Map<JobClass, MatrixCell>> PHs, NetworkStruct sn) Reindexes a map of phase-type (PH) distributions for a network model based on station and job class indices.
-
Constructor Details
-
MAM
public MAM()
-
-
Method Details
-
map_gamma2
Returns the largest non-unit eigenvalue (both real and imaginary parts) of the embedded Discrete-Time Markov Chain (DTMC) of a given Markovian Arrival Process (MAP).The function first computes the embedded DTMC transition matrix from the provided MAP. It then calculates the eigenvalues of this matrix and identifies the largest non-unit eigenvalue based on its magnitude. The eigenvalue's real and imaginary parts are returned.
- Parameters:
MAP
- The Markovian Arrival Process stored in a MatrixCell.- Returns:
- A double array of size 2, where the first element is the real part and the second element is the absolute value of the imaginary part of the largest non-unit eigenvalue.
-
map_mark
Creates a Marked Markovian Arrival Process (MMAP) by marking a given Markovian Arrival Process (MAP) with additional phases based on specified marking probabilities.This function constructs a new MMAP by extending the original MAP with additional phases, where each phase corresponds to a marking according to the provided probability matrix. If the marking probabilities do not sum to 1, they are normalized. The original MAP matrices are retained, and new matrices corresponding to the additional marked phases are generated and scaled according to the specified probabilities.
- Parameters:
MAP
- The original Markovian Arrival Process stored in a MatrixCell.prob
- A matrix containing the marking probabilities. Each column represents a different marking, and the sum of the elements is expected to be 1. If not, the probabilities are normalized.- Returns:
- A MatrixCell representing the Marked Markovian Arrival Process (MMAP), which includes the original MAP matrices and the additional matrices for the marked phases.
-
map_super
Creates a superposition of two Markovian Arrival Processes (MAPs) to form a new MAP.This function takes two input MAPs and constructs a superposed MAP by performing the Kronecker product of their corresponding matrices. The resulting MAP represents the combined behavior of the two input processes. After constructing the superposed MAP, it is normalized to ensure it represents a valid stochastic process.
- Parameters:
MAPa
- The first Markovian Arrival Process stored in a MatrixCell.MAPb
- The second Markovian Arrival Process stored in a MatrixCell.- Returns:
- A MatrixCell representing the superposed MAP, formed by combining the input MAPs.
-
map_normalize
Sanitizes the (D0, D1) matrices of a Markovian Arrival Process (MAP) by ensuring all elements are non-negative and adjusting diagonal elements.This function modifies the given hidden (D0) and visible (D1) transition matrices of a MAP to ensure they adhere to the necessary constraints for a valid MAP. Specifically, it sets any negative elements to zero and adjusts the diagonal elements of D0 such that each row sums to zero, preserving the stochastic nature of the matrix.
- Parameters:
D0
- The hidden transition matrix of the MAP, representing transitions that do not result in visible events.D1
- The visible transition matrix of the MAP, representing transitions that result in visible events.- Returns:
- A MatrixCell containing the sanitized D0 and D1 matrices.
-
map_normalize
Sanitizes the (D0, D1) matrices of a Markovian Arrival Process (MAP) stored in a MatrixCell.This function applies the sanitization process to the hidden (D0) and visible (D1) transition matrices of a MAP stored in a MatrixCell. It ensures that all elements are non-negative and adjusts the diagonal elements to maintain the stochastic nature of the matrices. The function is a convenience method that extracts the D0 and D1 matrices from the MAP and passes them to the more detailed sanitization function.
- Parameters:
MAP
- The Markovian Arrival Process stored in a MatrixCell, containing the (D0, D1) matrices.- Returns:
- A MatrixCell containing the sanitized (D0, D1) matrices.
-
map_infgen
Computes the infinitesimal generator matrix (Q) of the Continuous-Time Markov Chain (CTMC) underlying a Markovian Arrival Process (MAP).This function calculates the Q matrix by summing the hidden (D0) and visible (D1) transition matrices of the MAP. The resulting matrix Q represents the infinitesimal generator of the CTMC, which describes the rate of transitions between states.
- Parameters:
D0
- The hidden transition matrix of the MAP, representing transitions without visible events.D1
- The visible transition matrix of the MAP, representing transitions with visible events.- Returns:
- The CTMC infinitesimal generator matrix Q.
-
map_infgen
Computes the infinitesimal generator matrix (Q) of the Continuous-Time Markov Chain (CTMC) underlying a Markovian Arrival Process (MAP).This is a convenience method that extracts the D0 and D1 matrices from a given MAP stored in a MatrixCell and computes the Q matrix. The resulting matrix Q represents the infinitesimal generator of the CTMC, describing the rate of transitions between states.
- Parameters:
MAP
- The Markovian Arrival Process stored in a MatrixCell, containing the (D0, D1) matrices.- Returns:
- The CTMC infinitesimal generator matrix Q.
-
map_piq
Computes the steady-state vector (pi) of the Continuous-Time Markov Chain (CTMC) underlying a Markovian Arrival Process (MAP).This function calculates the steady-state distribution of the CTMC by solving for the stationary distribution of the infinitesimal generator matrix Q, which is obtained by summing the hidden (D0) and visible (D1) transition matrices.
- Parameters:
D0
- The hidden transition matrix of the MAP, representing transitions without visible events.D1
- The visible transition matrix of the MAP, representing transitions with visible events.- Returns:
- The steady-state vector (pi) of the CTMC.
-
map_piq
Computes the steady-state vector (pi) of the Continuous-Time Markov Chain (CTMC) underlying a Markovian Arrival Process (MAP).This is a convenience method that extracts the D0 and D1 matrices from a given MAP stored in a MatrixCell and computes the steady-state distribution of the CTMC by solving for the stationary distribution of the infinitesimal generator matrix Q.
- Parameters:
MAP
- The Markovian Arrival Process stored in a MatrixCell, containing the (D0, D1) matrices.- Returns:
- The steady-state vector (pi) of the CTMC.
-
map_mean
Computes the mean inter-arrival time of a Markovian Arrival Process (MAP).The mean inter-arrival time is calculated as the inverse of the overall arrival rate (lambda) of the MAP. This rate is derived from the hidden (D0) and visible (D1) transition matrices of the MAP.
- Parameters:
D0
- The hidden transition matrix of the MAP, representing transitions without visible events.D1
- The visible transition matrix of the MAP, representing transitions with visible events.- Returns:
- The mean inter-arrival time of the MAP.
-
map_mean
Computes the mean inter-arrival time of a Markovian Arrival Process (MAP) using matrices stored in a MatrixCell.This is a convenience method that extracts the D0 and D1 matrices from a given MAP stored in a MatrixCell and computes the mean inter-arrival time, which is the inverse of the overall arrival rate (lambda) of the MAP.
- Parameters:
MAP
- The Markovian Arrival Process stored in a MatrixCell, containing the (D0, D1) matrices.- Returns:
- The mean inter-arrival time of the MAP.
-
map_lambda
Computes the arrival rate (lambda) of a Markovian Arrival Process (MAP).The arrival rate is calculated using the hidden (D0) and visible (D1) transition matrices of the MAP. This is done by first determining the steady-state vector (pi) of the CTMC underlying the MAP and then using it to compute the rate at which visible transitions (events) occur.
- Parameters:
D0
- The hidden transition matrix of the MAP, representing transitions without visible events.D1
- The visible transition matrix of the MAP, representing transitions with visible events.- Returns:
- The arrival rate (lambda) of the MAP.
-
map_lambda
Computes the arrival rate (lambda) of a Markovian Arrival Process (MAP) using matrices stored in a MatrixCell.This is a convenience method that extracts the D0 and D1 matrices from a given MAP stored in a MatrixCell and computes the arrival rate (lambda). The computation involves using the steady-state vector (pi) of the CTMC underlying the MAP and determining the rate of visible transitions.
- Parameters:
MAP
- The Markovian Arrival Process stored in a MatrixCell, containing the (D0, D1) matrices.- Returns:
- The arrival rate (lambda) of the MAP.
-
map_hyperexp
Fit a two-phase Hyper-exponential renewal process as a MAP- Parameters:
mean
- : mean inter-arrival time of the processscv
- : squared coefficient of variation of inter-arrival timesp
- : p: probability of being served in phase 1 (DEFAULT: p=0.99)- Returns:
- Fitted hyper-exponential process
-
map_pie
Computes the steady-state probability vector of the embedded Discrete Time Markov Chain (DTMC) associated with a Markovian Arrival Process (MAP).The MAP is represented by two matrices: D0 and D1. D0 is the hidden transition matrix, representing transitions without an observed event, while D1 is the visible transition matrix, representing transitions with an observed event.
- Parameters:
D0
- the hidden transition matrix of the MAPD1
- the visible transition matrix of the MAP- Returns:
- the embedded steady-state probability vector
-
map_pie
Computes the steady-state probability vector of the embedded DTMC of a MAP stored in a MatrixCell that contains the MAP's transition matrices.- Parameters:
MAP
- a MatrixCell containing the transition matrices D0 and D1 of the MAP- Returns:
- the embedded steady-state probability vector
-
map_moment
Computes the raw moments of the inter-arrival times of a Markovian Arrival Process (MAP).The raw moment of a given order provides a measure of the shape of the distribution of inter-arrival times. The MAP is represented by two matrices: D0 and D1. D0 is the hidden transition matrix, representing transitions without an observed event, while D1 is the visible transition matrix, representing transitions with an observed event.
- Parameters:
D0
- the hidden transition matrix of the MAPD1
- the visible transition matrix of the MAPorder
- the moment order, i.e., E[X^order], where X is the inter-arrival time- Returns:
- the raw moment of the inter-arrival times of the specified order
-
map_moment
Computes the raw moments of the inter-arrival times of a MAP stored in a MatrixCell that contains the MAP's transition matrices.- Parameters:
MAP
- a MatrixCell containing the transition matrices D0 and D1 of the MAPorder
- the moment order, i.e., E[X^order], where X is the inter-arrival time- Returns:
- the raw moment of the inter-arrival times of the specified order
-
map_cdf
Computes the cumulative distribution function (CDF) of the inter-arrival times of a Markovian Arrival Process (MAP).The MAP is represented by two matrices: D0 and D1. D0 is the hidden transition matrix, representing transitions without an observed event, while D1 is the visible transition matrix, representing transitions with an observed event. The CDF values are calculated for a given set of points, which represent the inter-arrival times.
- Parameters:
D0
- the hidden transition matrix of the MAPD1
- the visible transition matrix of the MAPpoints
- a matrix containing the points at which to compute the CDF- Returns:
- a matrix containing the CDF values corresponding to the provided points
-
map_cdf
Computes the cumulative distribution function (CDF) of the inter-arrival times of a MAP stored in a MatrixCell that contains the MAP's transition matrices.- Parameters:
MAP
- a MatrixCell containing the transition matrices D0 and D1 of the MAPpoints
- a matrix containing the points at which to compute the CDF- Returns:
- a matrix containing the CDF values corresponding to the provided points
-
map_scv
Computes the squared coefficient of variation (SCV) of the inter-arrival times of a Markovian Arrival Process (MAP).The SCV is a normalized measure of the dispersion of the inter-arrival time distribution. It is calculated as the variance of the inter-arrival times divided by the square of the mean inter-arrival time. The MAP is represented by two matrices: D0 and D1, where D0 is the hidden transition matrix and D1 is the visible transition matrix.
- Parameters:
D0
- the hidden transition matrix of the MAPD1
- the visible transition matrix of the MAP- Returns:
- the squared coefficient of variation (SCV) of the inter-arrival times
-
map_scv
Computes the squared coefficient of variation (SCV) of the inter-arrival times of a MAP stored in a MatrixCell that contains the MAP's transition matrices.- Parameters:
MAP
- a MatrixCell containing the transition matrices D0 and D1 of the MAP- Returns:
- the squared coefficient of variation (SCV) of the inter-arrival times
-
map_scale
Rescales the mean inter-arrival time of a Markovian Arrival Process (MAP) to a specified new mean.This method adjusts the transition matrices D0 and D1 of the MAP to achieve a desired mean inter-arrival time while preserving the structure and relative rates of transitions. The MAP is represented by two matrices: D0 and D1, where D0 is the hidden transition matrix and D1 is the visible transition matrix.
- Parameters:
D0
- the hidden transition matrix of the MAPD1
- the visible transition matrix of the MAPnewMean
- the desired new mean inter-arrival time- Returns:
- a MatrixCell containing the scaled MAP transition matrices
-
map_scale
Rescales the mean inter-arrival time of a MAP stored in a MatrixCell that contains the MAP's transition matrices.- Parameters:
MAP
- a MatrixCell containing the transition matrices D0 and D1 of the MAPnewMean
- the desired new mean inter-arrival time- Returns:
- a MatrixCell containing the scaled MAP transition matrices
-
map_exponential
Creates a Markovian Arrival Process (MAP) with an exponential inter-arrival time distribution.The method constructs a MAP where the inter-arrival times are exponentially distributed with a specified mean. This is achieved by setting the rate parameter (mu) of the exponential distribution as 1/mean. The resulting MAP has a single state with transition matrices D0 and D1 that define the exponential arrival process.
- Parameters:
mean
- the desired mean of the exponential inter-arrival times- Returns:
- a MatrixCell containing the MAP transition matrices for the exponential distribution
-
map_sum
Computes the Markovian Arrival Process (MAP) representing the sum of `n` identical MAPs.This method constructs a new MAP with transition matrices `D0` and `D1` by summing `n` identical MAPs specified by the input `MAP`. The result is a larger MAP with `n` times the number of states in the original MAP, where transitions in the resulting MAP are structured to reflect the cumulative behavior of `n` MAPs.
- Parameters:
MAP
- the original MAP represented by a MatrixCell containing matrices `D0` and `D1`n
- the number of identical MAPs to sum- Returns:
- a MatrixCell containing the transition matrices `D0` and `D1` of the resulting summed MAP
-
map_sumind
Computes the Markovian Arrival Process (MAP) representing the sum of `n` independent MAPs.This method constructs a new MAP with transition matrices `D0` and `D1` by summing `n` independent MAPs, specified by the input array `MAPs`. The result is a larger MAP with the combined state space of the original MAPs, where transitions are structured to account for the independent nature of the original MAPs.
- Parameters:
MAPs
- an array of MatrixCells, each containing the transition matrices `D0` and `D1` of an independent MAP- Returns:
- a MatrixCell containing the transition matrices `D0` and `D1` of the resulting summed MAP
-
map_erlang
Fits an Erlang-k process as a Markovian Arrival Process (MAP).The Erlang-k process is characterized by k phases, each with an exponential distribution, resulting in a distribution with a mean and a coefficient of variation smaller than 1. This method constructs a MAP that approximates the behavior of an Erlang-k process with a specified mean and shape parameter k.
- Parameters:
mean
- the desired mean of the Erlang-k processk
- the shape parameter, representing the number of phases in the Erlang-k process- Returns:
- a MatrixCell containing the transition matrices `D0` and `D1` of the fitted MAP
-
map_idc
Computes the asymptotic index of dispersion (IDC) for a Markovian Arrival Process (MAP).The asymptotic index of dispersion is defined as:
I = SCV(1 + 2 * sum(\rho_k))
where SCV is the squared coefficient of variation, and \rho_k is the lag-k autocorrelation coefficient of inter-arrival times. It represents the limiting value of the index of dispersion for counts (IDC) and the index of dispersion for intervals (IDI).- Parameters:
D0
- the hidden transition matrix of the MAPD1
- the visible transition matrix of the MAP- Returns:
- the asymptotic index of dispersion
-
map_idc
Computes the asymptotic index of dispersion (IDC) for a MAP stored in a MatrixCell that contains the MAP's transition matrices.- Parameters:
MAP
- a MatrixCell containing the transition matrices D0 and D1 of the MAP- Returns:
- the asymptotic index of dispersion
-
aph_fit
Fits an acyclic phase-type (APH) distribution to the given moments of a random variable.This method approximates a random variable with an APH distribution, characterized by the first three moments: the mean (e1), the second moment (e2), and the third moment (e3). The APH distribution is represented as a MAP with two matrices: D0 and D1. If the second or third moment is infinite, the method defaults to fitting an exponential MAP.
The method iteratively tries to find an appropriate order `n` for the APH distribution up to a maximum order `nmax`. The order determines the number of phases in the distribution. If the moments cannot be matched exactly within the given `nmax`, an approximate solution is returned.
- Parameters:
e1
- the first moment (mean) of the distributione2
- the second moment of the distributione3
- the third moment of the distributionnmax
- the maximum number of phases to consider in the APH distribution- Returns:
- a MatrixCell containing the transition matrices `D0` and `D1` of the fitted APH distribution
-
aph_fit
Fits an acyclic phase-type (APH) distribution to the given moments of a random variable.This method approximates a random variable with an APH distribution, characterized by the first three moments: the mean (e1), the second moment (e2), and the third moment (e3). The APH distribution is represented as a MAP with two matrices: D0 and D1. If the second or third moment is infinite, the method defaults to fitting an exponential MAP.
This version of the method uses a default maximum order of 10 for the APH distribution.
- Parameters:
e1
- the first moment (mean) of the distributione2
- the second moment of the distributione3
- the third moment of the distribution- Returns:
- a MatrixCell containing the transition matrices `D0` and `D1` of the fitted APH distribution
-
aph2_fitall
Fits a set of acyclic phase-type (APH) distributions with two phases (APH(2)) to match the given moments of a random variable.This method approximates a random variable with multiple APH(2) distributions using the first three moments: the mean (M1), the second moment (M2), and the third moment (M3). The method checks the feasibility of these moments and computes the parameters for possible APH(2) distributions. If the moments cannot be exactly matched, an approximate APH(2) distribution is returned.
The method first calculates the squared coefficient of variation (SCV) and the lower bound for M3 (M3lb) based on the moments. It then determines the number of solutions (n) and computes the parameters (h1, h2, r1) for the APH(2) distributions. Valid distributions are stored in the map `APHS`, with each entry keyed by an integer and containing a MatrixCell representing the transition matrices `D0` and `D1`.
- Parameters:
M1
- the first moment (mean) of the distributionM2
- the second moment of the distributionM3
- the third moment of the distribution- Returns:
- a map containing possible APH(2) distributions, each represented by a MatrixCell
-
aph2_assemble
Assembles an acyclic phase-type (APH) distribution with two phases (APH(2)) using the given parameters.This method constructs the transition matrices `D0` and `D1` for an APH(2) distribution based on the parameters: `l1` and `l2` (the rates of the exponential phases), and `p1` (the probability of transitioning between the phases). The resulting distribution has two phases, each represented by an exponential distribution, with transitions between the phases as specified by the given parameters.
- Parameters:
l1
- the rate of the first exponential phasel2
- the rate of the second exponential phasep1
- the probability of transitioning from the first phase to the second phase- Returns:
- a MatrixCell containing the transition matrices `D0` and `D1` of the APH(2) distribution
-
mmap_count_mean
Computes the mean count vector of events of different types in a Markovian Arrival Process with marked arrivals (MMAP) over a time period.This method calculates the expected number of events of each type over a given time period `t` for a MMAP, which is represented by a set of matrices. The MMAP contains multiple types of arrivals, each represented by a separate matrix in the `MMAP` MatrixCell. The count mean for each type of event is computed using the stationary distribution of the underlying Markov chain (`theta`) and the event matrices.
- Parameters:
MMAP
- the MatrixCell containing the transition matrices of the MMAP, with D0, D1, ..., Dc representing different types of eventst
- the time period over which to compute the mean counts- Returns:
- a Matrix containing the mean count vector of events over time `t`
-
mmap_count_var
Computes the variance of the count vector of events of different types in a Markovian Arrival Process with marked arrivals (MMAP) over a time period.This method calculates the variance of the number of events of each type over a given time period `t` for a MMAP, represented by a set of matrices. The MMAP contains multiple types of arrivals, each represented by a separate matrix in the `MMAP` MatrixCell. The variance for each type of event is computed using the stationary distribution of the underlying Markov chain (`theta`), the infinitesimal generator matrix (`Q`), and the event matrices.
- Parameters:
MMAP
- the MatrixCell containing the transition matrices of the MMAP, with D0, D1, ..., Dc representing different types of eventst
- the time period over which to compute the variances of counts- Returns:
- a Matrix containing the variance vector of counts over time `t`
-
mmap_count_idc
Computes the index of dispersion for counts (IDC) for a Markovian Arrival Process with marked arrivals (MMAP) over a time period.The IDC is calculated as the variance of the counts divided by the mean of the counts. This method computes the IDC for each type of event in the MMAP over a specified time period `t`.
- Parameters:
MMAP
- the MatrixCell containing the transition matrices of the MMAP, with D0, D1, ..., Dc representing different types of eventst
- the time period over which to compute the IDC- Returns:
- a Matrix containing the IDC for each type of event over time `t`
-
mmap_idc
Computes the asymptotic index of dispersion for counts (IDC) for a Markovian Arrival Process with marked arrivals (MMAP).This method calculates the IDC for each type of event in the MMAP as t approaches infinity, using an approximation for large time `t`. The IDC is computed as the variance of the counts divided by the mean of the counts for each type of event.
- Parameters:
MMAP
- the MatrixCell containing the transition matrices of the MMAP, with D0, D1, ..., Dc representing different types of events- Returns:
- a Matrix containing the IDC for each type of event as time approaches infinity
-
mmap_isfeasible
Checks the feasibility of a Markovian Arrival Process with marked arrivals (MMAP).This method verifies whether the given MMAP is feasible, which includes checking: 1. The underlying MAP (formed by matrices D0 and D1) is feasible. 2. The elements of each additional event matrix (D1c) are non-negative. 3. The sum of the matrices representing different event types (D1c) does not exceed the visible transition matrix (D1) in absolute value.
- Parameters:
MMAP
- the MatrixCell containing the transition matrices of the MMAP, with D0, D1, ..., Dc representing different types of events- Returns:
- true if the MMAP is feasible, false otherwise
-
mmap_compress
Compresses a Markovian Arrival Process with marked arrivals (MMAP) based on the provided configuration options.This method reduces the complexity of the given MMAP by fitting a simpler model to the data. Depending on the configuration method specified in `config`, different compression techniques are applied: - "default", "mixture", or "mixture.order1": These methods involve fitting a 2-phase Markovian arrival process (MMPP2) to the MMAP. - "mixture.order2": Placeholder for future implementation.
- Parameters:
MMAP
- the MatrixCell containing the transition matrices of the original MMAPconfig
- the configuration options specifying the compression method- Returns:
- a compressed MatrixCell representation of the MMAP
-
mmap_compress
Compresses a Markovian Arrival Process with marked arrivals (MMAP) as a mixture of 2-state acyclic Markovian Arrival Processes (MAPs).This method reduces the complexity of the given MMAP by approximating it with a mixture of 2-state acyclic MAPs. Each component of the MMAP is fitted to a 2-state MAP using a 2-phase Markov-Modulated Poisson Process (MMPP2) fitting procedure. The resulting compressed representation aims to retain the essential statistical characteristics of the original process, such as the mean, squared coefficient of variation (SCV), skewness, and index of dispersion for counts (IDC).
- Parameters:
MMAP
- the MatrixCell containing the transition matrices of the original MMAP- Returns:
- a MatrixCell representation of the compressed MMAP
-
ph_reindex
public static Map<Integer,Map<Integer, ph_reindexMatrixCell>> (Map<Station, Map<JobClass, MatrixCell>> PHs, NetworkStruct sn) Reindexes a map of phase-type (PH) distributions for a network model based on station and job class indices.This method takes a map of PH distributions, originally indexed by Station and JobClass objects, and reindexes it using integer indices for stations and job classes. The new index system corresponds to the internal indexing used in a NetworkStruct object, which describes the structure of the network, including the number of stations and classes.
- Parameters:
PHs
- a map where the key is a Station and the value is another map with a JobClass key and MatrixCell value representing the PH distributionsn
- the NetworkStruct object containing the network structure and internal indexing information- Returns:
- a reindexed map where the key is an integer station index and the value is another map with integer job class indices and MatrixCell values
-
mmap_shorten
Converts an MMAP representation from M3A format to BUTools format.In the M3A format, an MMAP is represented as a MAP followed by multiple D1 matrices for different markings (D0, D1, D1a, D1b, ...). In the BUTools format, the MMAP representation skips the initial D1 matrix, directly listing the marking matrices (D0, D1a, D1b, ...). This method reorders the matrices accordingly.
- Parameters:
mmap
- the MatrixCell containing the MMAP representation in M3A format- Returns:
- a MatrixCell representing the MMAP in BUTools format
-
mmap_timereverse
Computes the time-reversed version of a Markovian Arrival Process with marked arrivals (MMAP).This method takes an MMAP and returns its time-reversed version. The time-reversed MMAP is computed by transposing the transition matrices and adjusting them using the stationary distribution of the underlying Markov chain. The resulting matrices represent the same process viewed in reverse time.
- Parameters:
mmap
- the MatrixCell containing the transition matrices of the original MMAP- Returns:
- a MatrixCell representing the time-reversed MMAP
-
aph2_fit
Fits an acyclic phase-type (APH) distribution with two phases (APH(2)) to match the given moments of a random variable.This method attempts to fit an APH(2) distribution based on the first three moments (M1, M2, M3) of the distribution. If a valid APH(2) distribution cannot be directly obtained, the method adjusts the moments and retries the fitting process. If the fitting still fails, it throws an exception indicating that feasibility could not be restored.
- Parameters:
M1
- the first moment (mean) of the distributionM2
- the second moment of the distributionM3
- the third moment of the distribution- Returns:
- an object of type `aph2_fit_return_type` containing the fitted APH(2) distribution and all possible fits
- Throws:
RuntimeException
- if the APH(2) fitting is not feasible with the given or adjusted moments
-
aph2_adjust
Adjusts the second and third moments (M2 and M3) of a distribution for fitting an APH(2) distribution.This method adjusts the given moments M2 and M3 based on the specified method. The adjustment aims to ensure that the moments are within feasible bounds for fitting an APH(2) distribution. Currently, the method "simple" is implemented, which adjusts the moments based on certain criteria related to the squared coefficient of variation (SCV).
- Parameters:
M1
- the first moment (mean) of the distributionM2
- the second moment of the distributionM3
- the third moment of the distributionmethod
- the adjustment method to be used ("simple" is currently implemented)- Returns:
- a map with keys 0 and 1, representing the adjusted M2 and M3, respectively
-
aph2_adjust
Adjusts the second and third moments (M2 and M3) of a distribution using the default "simple" method for fitting an APH(2) distribution.This method calls `aph2_adjust` with the "simple" adjustment method, which is designed to ensure that the moments are within feasible bounds for fitting an APH(2) distribution. This adjustment helps in stabilizing the fitting process by correcting moments that may otherwise be infeasible.
- Parameters:
M1
- the first moment (mean) of the distributionM2
- the second moment of the distributionM3
- the third moment of the distribution- Returns:
- a map with keys 0 and 1, representing the adjusted M2 and M3, respectively
-
mamap2m_fit_gamma_fb_mmap
-
mmap_exponential
Fits an order-n Markovian Arrival Process with marked arrivals (MMAP) based on the given arrival rates for each job class.This method constructs an MMAP with `n` states for each job class, where each class has its own arrival rate specified by the matrix `lambda`. The resulting MMAP includes a D0 matrix for the hidden transitions, a D1 matrix for visible transitions, and additional matrices for each job class marking the type of arrival.
- Parameters:
lambda
- a 1xK matrix describing the arrival rates for each job class, where K is the number of job classesn
- the number of states in the MMAP- Returns:
- a MatrixCell representing the MMAP with the specified characteristics
-
mmap_exponential
Fits a Markovian Arrival Process with marked arrivals (MMAP) with a single state based on the given arrival rates for each job class.This method constructs an MMAP with a single state (`n = 1`) for each job class, using the arrival rates specified by the matrix `lambda`. It is a simplified version of the `mmap_exponential` function that defaults to one state per job class.
- Parameters:
lambda
- a 1xK matrix describing the arrival rates for each job class, where K is the number of job classes- Returns:
- a MatrixCell representing the MMAP with the specified arrival rates and a single state
-
mmap_normalize
Normalizes a Markovian Arrival Process with marked arrivals (MMAP) to ensure feasibility.This method adjusts the MMAP by setting negative off-diagonal values in the D0 matrix to zero and ensuring that all elements in the marking matrices are non-negative. It also recalculates the D1 matrix to reflect the sum of the marking matrices. The diagonal elements of the D0 matrix are adjusted to ensure that each row sums to zero, maintaining the properties of a valid generator matrix.
- Parameters:
MMAP
- the MatrixCell representing the MMAP to be normalized- Returns:
- the normalized MatrixCell, or null if the input MMAP is empty
-
mmap_mark
Converts a Markovian Arrival Process with marked arrivals (MMAP) into a new MMAP with redefined classes based on a given probability matrix.This method reclassifies the arrivals in an MMAP according to a provided probability matrix. The probability matrix defines the likelihood that an arrival of a particular type in the original MMAP is marked as a different type in the new MMAP. The resulting MMAP has a new set of output types (classes) based on these probabilities.
- Parameters:
MMAP
- the original MMAP with K typesprob
- a KxR matrix describing the probability of a type-k arrival in the original MMAP being marked as a type-r arrival in the new MMAP- Returns:
- a new MMAP with R types (classes)
-
mmap_scale
Changes the mean inter-arrival time of a Markovian Arrival Process with marked arrivals (MMAP).This method scales the MMAP to achieve a desired mean inter-arrival time. If a single new mean (M) is provided, the method scales all matrices (D0, D1, and the marking matrices) uniformly. If a matrix M is provided with different desired means for each class, the method scales each class independently.
- Parameters:
MMAP
- the original MMAP to be scaledM
- a matrix containing the new mean inter-arrival times; can be a single value or a vector with one value per class- Returns:
- the scaled MMAP with adjusted mean inter-arrival times
-
mmap_count_lambda
Computes the arrival rate vector of the counting process for the given Marked MAP (MMAP).This method calculates the arrival rates for each job class in the MMAP. The arrival rate for each class is determined by multiplying the stationary distribution of the underlying Markov chain (computed by `map_piq`) with the corresponding marking matrix and summing the elements. The result is a vector of arrival rates, one for each job class.
- Parameters:
mmap
- the Marked MAP represented by a MatrixCell- Returns:
- a matrix (vector) with the arrival rate for each job class
-
mmap_lambda
Alias for mmap_count_lambda.This method provides an alternative name for `mmap_count_lambda`, offering the same functionality.
- Parameters:
MMAP
- the Marked MAP represented by a MatrixCell- Returns:
- a matrix (vector) with the arrival rate for each job class
-
mmap_super
Combines two MMAPs into one superposed MMAP.This method creates a superposed MMAP from two given MMAPs (MMAPa and MMAPb). Depending on the option specified: - "default": Treats the MMAPs as unrelated, and each class in MMAPa and MMAPb is considered distinct in the resulting superposed MMAP. - "match": Assumes that MMAPa and MMAPb have the same number of classes and maps corresponding classes from both into the same class in the superposed MMAP.
- Parameters:
MMAPa
- the first MMAPMMAPb
- the second MMAPopt
- "default" for unrelated MMAPs, "match" for matching classes- Returns:
- a new MMAP representing the superposition of the input MMAPs
-
mmap_super
Combines two MMAPs into one superposed MMAP using the default option.- Parameters:
MMAPa
- the first MMAPMMAPb
- the second MMAP- Returns:
- a new MMAP representing the superposition of the input MMAPs
-
mmap_super
Combines a list of MMAPs into one superposed MMAP.This method removes null entries from the list and then superposes the remaining MMAPs.
- Parameters:
MMAPa
- the list of MMAPs to be combined- Returns:
- a new MMAP representing the superposition of the input MMAPs
-
mmap_hide
Hides specified types of arrivals in a Markovian Arrival Process with marked arrivals (MMAP).This method creates a new MMAP where the specified arrival types are hidden, meaning they are removed from the observation but the underlying stochastic process remains the same. The hidden types are set to zero matrices, effectively removing their impact from the observed data.
- Parameters:
MMAP
- the original MMAPtypes
- a matrix containing the indices of the types to be hidden- Returns:
- a new MMAP with the specified types hidden
-
mmap_maps
Extracts K Markovian Arrival Processes (MAPs) from a given MMAP, one for each class.This method creates a MAP for each class in the MMAP by separating the transitions related to that class. Each resulting MAP has its own set of transition matrices, derived from the original MMAP.
- Parameters:
MMAP
- the original MMAP- Returns:
- a map containing K MAPs, each stored in a MatrixCell
-
mmap_mixture_fit_mmap
Fits a mixture of Markovian Arrival Processes (MMAPs) to match the given moments.This method first computes the second-order cross-moments (`P2`) and the first three cross-moments (`M1`, `M2`, `M3`) of the given MMAP. It then fits a mixture of MMAPs to match these moments, returning the parameters of the fitted mixture.
- Parameters:
mmap
- the original MMAP to be fitted- Returns:
- a `mmap_mixture_fit_return_type` containing the fitted mixture parameters
-
mmap_mixture_fit
public static Ret.mamMMAPMixtureFit mmap_mixture_fit(Map<Integer[], Matrix> P2, Matrix M1, Matrix M2, Matrix M3) Fits a mixture of Markovian Arrival Processes (MMAPs) to match the given cross-moments.This method takes second-order cross-moments (`P2`) and the first three cross-moments (`M1`, `M2`, `M3`) and fits a mixture of MMAPs to these moments. The method uses an APH(2) fitting procedure for each pair of moments and constructs a new MMAP based on these fitted models.
- Parameters:
P2
- a map representing second-order cross-moments of the MMAPM1
- a matrix representing the first cross-momentM2
- a matrix representing the second cross-momentM3
- a matrix representing the third cross-moment- Returns:
- a `mmap_mixture_fit_return_type` containing the fitted mixture MMAP and associated phase-type distributions
-
mmap_cross_moment
Computes the k-th cross-moment matrix for a given MMAP.This method calculates the k-th cross-moments for each pair of types in the MMAP. The cross-moment measures the expected value of the product of k inter-arrival times for different types in the MMAP. The result is a CxC matrix, where C is the number of types.
- Parameters:
mmap
- the MMAP for which to compute the cross-momentsk
- the order of the moment to compute- Returns:
- a matrix representing the k-th cross-moment for each pair of types
-
mmap_sigma2
Computes the second-order sigma values (covariances) for a given MMAP.This method calculates second-order cross-moments for the MMAP, which represent the covariances between inter-arrival times of different types. The result is a map where the keys are integer arrays representing pairs of types, and the values are matrices of the computed sigma values.
- Parameters:
mmap
- the MMAP for which to compute the second-order sigma values- Returns:
- a map with keys as integer arrays representing pairs of types and values as matrices of sigma values
-
mmap_super_safe
public static MatrixCell mmap_super_safe(Map<Integer, MatrixCell> MMAPS, int maxorder, String method) Safely combines multiple MMAPs into a single superposed MMAP while considering order constraints.This method creates a superposed MMAP from a given set of MMAPs, ensuring that the combined MMAP does not exceed a specified maximum order (`maxorder`). The MMAPs are combined in an order determined by the squared coefficient of variation (SCV) of the unmarked processes. If combining two MMAPs would exceed the maximum order, alternative methods are used, such as fitting to an exponential or using a simplified MAP.
- Parameters:
MMAPS
- a map of MMAPs to be combinedmaxorder
- the maximum allowed order for the resulting superposed MMAPmethod
- the method for combining MMAPs; "default" or "match"- Returns:
- a MatrixCell representing the combined superposed MMAP
-
mmap_super_safe
Safely combines multiple MMAPs into a single superposed MMAP using the default method, while considering order constraints.This method is a convenience overload that uses the "default" method for combining MMAPs. It creates a superposed MMAP from a given set of MMAPs, ensuring that the combined MMAP does not exceed a specified maximum order (`maxorder`). The MMAPs are combined in an order determined by the squared coefficient of variation (SCV) of the unmarked processes.
- Parameters:
MMAPS
- a map of MMAPs to be combinedmaxorder
- the maximum allowed order for the resulting superposed MMAP- Returns:
- a MatrixCell representing the combined superposed MMAP
-
mmap_pc
Computes the proportion of counts (PC) for each type in a Markovian Arrival Process with marked arrivals (MMAP).This method calculates the proportion of arrivals attributed to each type in the MMAP. It does so by computing the stationary distribution of the underlying Markov chain and using it to weight the arrivals from each type.
- Parameters:
MMAP
- the MMAP from which to compute the proportions- Returns:
- a matrix where each element represents the proportion of counts for a type
-
mmap_forward_moment
Computes the forward moments of an MMAP for specified orders.This method calculates the forward moments of the inter-arrival times for each type in the MMAP according to the specified orders. The moments are normalized based on the parameter `NORM`.
- Parameters:
MMAP
- the MMAP from which to compute the forward momentsORDERS
- a matrix specifying the orders of the moments to be computedNORM
- a normalization parameter; if 1, the moments are normalized, otherwise they are not- Returns:
- a matrix where each row corresponds to a type and each column corresponds to a moment order
-
mmap_forward_moment
Computes the forward moments of an MMAP for specified orders with normalization.This method calculates the forward moments of the inter-arrival times for each type in the MMAP according to the specified orders, with moments normalized by default.
- Parameters:
MMAP
- the MMAP from which to compute the forward momentsORDERS
- a matrix specifying the orders of the moments to be computed- Returns:
- a matrix where each row corresponds to a type and each column corresponds to a moment order
-
mmap_backward_moment
Computes the backward moments of an MMAP for specified orders.This method calculates the backward moments of the inter-arrival times for each type in the MMAP according to the specified orders. The moments can be normalized based on the parameter `NORM`.
- Parameters:
MMAP
- the MMAP from which to compute the backward momentsORDERS
- a matrix specifying the orders of the moments to be computedNORM
- a normalization parameter; if 1, the moments are normalized, otherwise they are not- Returns:
- a matrix where each row corresponds to a type and each column corresponds to a moment order
-
mmap_backward_moment
Computes the backward moments of an MMAP for specified orders with normalization.This method calculates the backward moments of the inter-arrival times for each type in the MMAP according to the specified orders, with moments normalized by default.
- Parameters:
MMAP
- the MMAP from which to compute the backward momentsORDERS
- a matrix specifying the orders of the moments to be computed- Returns:
- a matrix where each row corresponds to a type and each column corresponds to a moment order
-
mmap_mixture
Creates a mixture of MMAPs using the given weights (alpha) and MAPs.This method combines multiple MAPs into a single MMAP, weighted by the vector `alpha`. Each MAP is assumed to have its own transition matrices, and the combination is done in a way that preserves the stochastic properties of the original processes.
- Parameters:
alpha
- a matrix (vector) representing the weights for each MAP in the mixtureMAPs
- a map containing the individual MAPs to be combined, indexed by integer keys- Returns:
- a MatrixCell representing the combined MMAP
-
mmpp2_fit_mu00
public static double mmpp2_fit_mu00(double E1, double E2, double E3, double G2) -
mmpp2_fit_mu11
public static double mmpp2_fit_mu11(double E1, double E2, double E3, double G2) -
mmpp2_fit_q01
public static double mmpp2_fit_q01(double E1, double E2, double E3, double G2) -
mmpp2_fit_q10
public static double mmpp2_fit_q10(double E1, double E2, double E3, double G2) -
mmpp2_fit
Fits a 2-phase Markovian Arrival Process (MMPP2) to match the given first three moments and a fourth parameter G2.This method calculates the rates (mu00, mu11) and transition rates (q01, q10) for a 2-phase MMPP based on the given moments (E1, E2, E3) and the G2 parameter, which could represent a correlation or variability metric.
- Parameters:
E1
- the first moment (mean)E2
- the second momentE3
- the third momentG2
- an additional parameter, often related to the index of dispersion or other characteristic- Returns:
- a MatrixCell containing the transition matrices for the MMPP2
-
map2_fit
Fits a 2-phase Markovian Arrival Process (MAP2) to match the given moments and decay rate of the autocorrelation function.This method calculates the parameters for a 2-phase MAP based on the first three moments (e1, e2, e3) and the decay rate (g2) of the autocorrelation function.
- Parameters:
e1
- the first moment (mean)e2
- the second momente3
- the third momentg2
- the decay rate of the autocorrelation function- Returns:
- a Map_fit_return_type object containing the fitted MAP transition matrices and additional fitting information
-
map2_fit
Fits a 2-phase Markovian Arrival Process (MAP2) using the first three moments.This method provides a simplified fitting interface when `g2` is not available or specified. It uses a default or inferred value for `g2` based on the provided moments.
- Parameters:
e1
- the first moment (mean)e2
- the second momente3
- the third moment- Returns:
- a mapFitReturn object containing the fitted MAP transition matrices and additional fitting information
-
map_isfeasible
Checks if the provided MAP is feasible based on the given tolerance.This method evaluates whether the MAP transition matrices meet the necessary conditions for a valid MAP, such as non-negativity of elements, proper row/column sums, etc.
- Parameters:
MAP
- the MatrixCell representing the MAP transition matricesTOL
- the tolerance level for numerical stability checks- Returns:
- true if the MAP is feasible, false otherwise
-
map_isfeasible
Checks if the provided MAP is feasible using a default tolerance.This method uses a standard tolerance level to determine the feasibility of the MAP.
- Parameters:
MAP
- the MatrixCell representing the MAP transition matrices- Returns:
- true if the MAP is feasible, false otherwise
-
map_checkfeasible
Placeholder method to check the feasibility of a MAP. Actual implementation should ensure that the transition matrices of the MAP satisfy the necessary conditions for a valid MAP.- Parameters:
MAP
- the MatrixCell representing the MAP transition matricesTOL
- the tolerance level for numerical stability checks- Returns:
- true if the MAP is feasible, false otherwise
-
map_largemap
public static int map_largemap()Returns the maximum size considered for large MAPs.This method provides a standard size threshold for determining what constitutes a large MAP. This threshold might be used in performance optimizations or to decide when to switch to more efficient algorithms.
- Returns:
- the size threshold for large MAPs
-
map_feastol
public static int map_feastol()Returns the feasibility tolerance for MAPs.This method provides a standard tolerance level used in feasibility checks for MAPs. It might be used to determine the numerical accuracy required in calculations involving MAPs.
- Returns:
- the feasibility tolerance value
-
map_embedded
Computes the embedded discrete-time Markov chain (DTMC) matrix of a MAP.This method calculates the embedded DTMC matrix by first inverting the negative of the D0 matrix and then multiplying it by the D1 matrix. The resulting matrix represents the probabilities of transitioning between states in the embedded chain.
- Parameters:
D0
- the hidden transition matrix of the MAPD1
- the visible transition matrix of the MAP- Returns:
- the embedded DTMC matrix
-
map_embedded
Computes the embedded discrete-time Markov chain (DTMC) matrix of a MAP given as a MatrixCell.This method is a convenience overload that extracts the D0 and D1 matrices from the provided MatrixCell and calculates the embedded DTMC matrix.
- Parameters:
MAP
- the MatrixCell representing the MAP, containing the D0 and D1 matrices- Returns:
- the embedded DTMC matrix
-
map_acf
Computes the autocorrelation function (ACF) for a given MAP at a specific lag.This method calculates the ACF for the specified lag by first creating a singleton matrix with the lag value. It then calls the overloaded `map_acf` method that accepts a matrix of lags.
- Parameters:
D0
- the hidden transition matrix of the MAPD1
- the visible transition matrix of the MAPlag
- the specific lag at which to compute the ACF- Returns:
- a matrix containing the ACF value at the specified lag
-
map_acf
Computes the autocorrelation function (ACF) for a given MAP at multiple lags.This method calculates the ACF values for the specified lags by computing the embedded DTMC matrix, the stationary distribution vector, and the steady-state vector. The ACF values are normalized by the squared coefficient of variation (SCV) of the inter-arrival times.
- Parameters:
D0
- the hidden transition matrix of the MAPD1
- the visible transition matrix of the MAPlags
- a matrix containing the lags at which to compute the ACF- Returns:
- a matrix containing the ACF values at the specified lags
-
map_acf
Computes the autocorrelation function (ACF) for a given MAP at multiple lags using a MatrixCell.This method is a convenience overload that extracts the D0 and D1 matrices from the provided MatrixCell and calculates the ACF for the specified lags.
- Parameters:
MAP
- the MatrixCell representing the MAP, containing the D0 and D1 matriceslags
- a matrix containing the lags at which to compute the ACF- Returns:
- a matrix containing the ACF values at the specified lags
-
map_acfc
Computes the autocorrelation function coefficients (ACFC) for a MAP counting process.This method calculates the ACFC for a given MAP represented by matrices D0 and D1, at specified lags and over a specified timescale (u). The ACFC provides insight into the temporal correlation of event counts over time.
- Parameters:
D0
- the hidden transition matrix of the MAPD1
- the visible transition matrix of the MAPlags
- an array of integers representing the lags at which to compute the ACFCu
- the length of the timeslot (timescale)- Returns:
- an array of doubles containing the ACFC values for the specified lags
-
map_acfc
Computes the autocorrelation function coefficients (ACFC) for a MAP counting process using a MatrixCell.This method is a convenience overload that extracts the D0 and D1 matrices from the provided MatrixCell and calculates the ACFC for the specified lags and timescale.
- Parameters:
MAP
- the MatrixCell representing the MAP, containing the D0 and D1 matriceslags
- an array of integers representing the lags at which to compute the ACFCu
- the length of the timeslot (timescale)- Returns:
- an array of doubles containing the ACFC values for the specified lags
-
map_acf
Computes the autocorrelation function (ACF) for a given MAP using a default lag of 1.This method calculates the ACF at lag 1 for the MAP described by the matrices D0 and D1. It is a convenience method for cases where only the first lag's ACF is of interest.
- Parameters:
D0
- the hidden transition matrix of the MAPD1
- the visible transition matrix of the MAP- Returns:
- a matrix containing the ACF value at lag 1
-
map_acf
Computes the autocorrelation function (ACF) for a given MAP using a default lag of 1.This method is a convenience overload that extracts the D0 and D1 matrices from the provided MatrixCell and calculates the ACF at lag 1.
- Parameters:
MAP
- the MatrixCell representing the MAP, containing the D0 and D1 matrices- Returns:
- a matrix containing the ACF value at lag 1
-
map_skew
Computes the skewness of the inter-arrival times for a MAP.The skewness measures the asymmetry of the distribution of inter-arrival times. It is calculated using the third central moment normalized by the cube of the standard deviation.
- Parameters:
D0
- the hidden transition matrix of the MAPD1
- the visible transition matrix of the MAP- Returns:
- the skewness of the inter-arrival times
-
map_skew
Computes the skewness of the inter-arrival times for a MAP using a MatrixCell.This method is a convenience overload that extracts the D0 and D1 matrices from the provided MatrixCell and calculates the skewness of the inter-arrival times.
- Parameters:
MAP
- the MatrixCell representing the MAP, containing the D0 and D1 matrices- Returns:
- the skewness of the inter-arrival times
-
map_var
Computes the variance of the inter-arrival times for a MAP.The variance is calculated as the difference between the second moment and the square of the mean inter-arrival time.
- Parameters:
D0
- the hidden transition matrix of the MAPD1
- the visible transition matrix of the MAP- Returns:
- the variance of the inter-arrival times
-
map_var
Computes the variance of the inter-arrival times for a MAP using a MatrixCell.This method is a convenience overload that extracts the D0 and D1 matrices from the provided MatrixCell and calculates the variance of the inter-arrival times.
- Parameters:
MAP
- the MatrixCell representing the MAP, containing the D0 and D1 matrices- Returns:
- the variance of the inter-arrival times
-
map_varcount
Computes the variance of the counts in a MAP over a time period t.This method calculates the variance of the number of events that occur in the MAP over the specified time interval t. It involves matrix operations that consider the MAP's transition structure and steady-state behavior.
- Parameters:
D0
- the hidden transition matrix of the MAPD1
- the visible transition matrix of the MAPt
- the time period over which to compute the variance of counts- Returns:
- the variance of the counts over time t
-
map_varcount
Computes the variance of the counts in a MAP over multiple time periods.This method calculates the variance for each time period specified in the matrix t.
- Parameters:
D0
- the hidden transition matrix of the MAPD1
- the visible transition matrix of the MAPt
- a matrix containing the time periods over which to compute the variance of counts- Returns:
- a matrix containing the variance of counts for each time period in t
-
map_varcount
Computes the variance of the counts in a MAP over a time period t using a MatrixCell.This method is a convenience overload that extracts the D0 and D1 matrices from the provided MatrixCell and calculates the variance of the counts over time t.
- Parameters:
MAP
- the MatrixCell representing the MAP, containing the D0 and D1 matricest
- the time period over which to compute the variance of counts- Returns:
- the variance of the counts over time t
-
map_varcount
Computes the variance of the counts in a MAP over multiple time periods using a MatrixCell.This method is a convenience overload that extracts the D0 and D1 matrices from the provided MatrixCell and calculates the variance of the counts over multiple time periods specified in the matrix t.
- Parameters:
MAP
- the MatrixCell representing the MAP, containing the D0 and D1 matricest
- a matrix containing the time periods over which to compute the variance of counts- Returns:
- a matrix containing the variance of counts for each time period in t
-
mmpp2_fit1
Fits a 2-phase Markov Modulated Poisson Process (MMPP2) based on the specified parameters.- Parameters:
mean
- the mean inter-arrival timescv
- the squared coefficient of variation (SCV)skew
- the skewness of the inter-arrival timesidc
- the index of dispersion for counts (IDC)- Returns:
- a MatrixCell representing the fitted MMPP2 transition matrices
-
map_rand
Generates a random Markovian Arrival Process (MAP) with K states.- Parameters:
K
- the number of states- Returns:
- a MatrixCell representing the random MAP transition matrices
-
map_randn
Generates a random Markovian Arrival Process (MAP) with K states using normal distribution.- Parameters:
K
- the number of statesmu
- the mean of the normal distributionsigma
- the standard deviation of the normal distribution- Returns:
- a MatrixCell representing the random MAP transition matrices
-
map_sample
Generates samples of inter-arrival times from a MAP using a specified number of samples and a random generator.This method generates `n` samples of inter-arrival times from the MAP defined by matrices D0 and D1. If the MAP has a single phase, the samples are generated from an exponential distribution. For multi-phase MAPs, the sampling accounts for transitions between states/phases.
- Parameters:
MAP
- the MatrixCell representing the MAP, containing the D0 and D1 matricesn
- the number of samples to generaterandom
- the random number generator to use- Returns:
- an array of doubles containing the generated samples
-
map_sample
Generates samples of inter-arrival times from a MAP using a specified number of samples and a random generator.- Parameters:
D0
- the hidden transition matrix of the MAPD1
- the visible transition matrix of the MAPn
- the number of samples to generaterandom
- the random number generator to use- Returns:
- an array of doubles containing the generated samples
-
mmap_sample
Generates samples of inter-arrival times and event types from a MMAP using a specified number of samples.- Parameters:
MMAP
- the MatrixCell representing the MMAP, containing the D0, D1 matrices and additional marking matricesn
- the number of samples to generate- Returns:
- an mmapSampleReturn object containing the generated samples and their corresponding types
-
mmap_sample
Generates samples of inter-arrival times and event types from a MMAP using a specified number of samples and a random generator.- Parameters:
MMAP
- the MatrixCell representing the MMAP, containing the D0, D1 matrices and additional marking matricesn
- the number of samples to generaterandom
- the random number generator to use- Returns:
- an mmapSampleReturn object containing the generated samples and their corresponding types
-
map_gamma
Computes the gamma parameter for a MAP, which is the ratio of the ACF values at lag 2 and lag 1.For phase-type distributions (or when the ACF at lag 1 is nearly zero), the gamma is defined to be zero. Otherwise, gamma is calculated as the ratio of the ACF at lag 2 to the ACF at lag 1.
- Parameters:
D0
- the hidden transition matrix of the MAPD1
- the visible transition matrix of the MAP- Returns:
- the gamma parameter
-
map_gamma
Computes the gamma parameter for a MAP using a MatrixCell.This method is a convenience overload that extracts the D0 and D1 matrices from the provided MatrixCell and calculates the gamma parameter.
- Parameters:
MAP
- the MatrixCell representing the MAP, containing the D0 and D1 matrices- Returns:
- the gamma parameter
-
mmap_rand
Generates a random MMAP (Marked Markovian Arrival Process) with a given order and number of classes.- Parameters:
order
- the number of phases (order) in the MAPclasses
- the number of different classes (types) of arrivals in the MMAP- Returns:
- a MatrixCell representing the MMAP, containing the D0, D1 matrices, and class-specific matrices
-
map_timereverse
Computes the time-reversed MAP of a given MAP.The time-reversed MAP has transition rates adjusted based on the stationary distribution of the original MAP.
- Parameters:
map
- the original MAP stored in a MatrixCell containing the D0 and D1 matrices- Returns:
- a MatrixCell representing the time-reversed MAP, containing the reversed D0 and D1 matrices
-
map_count_mean
Computes the mean of the counting process over a specified interval length for a given Markovian Arrival Process (MAP).This function calculates the mean number of events that occur in a MAP over an interval of length
t
. It uses the arrival rate of the MAP, denoted as lambda (λ), and multiplies it by the interval lengtht
.- Parameters:
MAP
- The Markovian Arrival Process stored in a MatrixCell.t
- The length of the interval over which to compute the mean.- Returns:
- The mean of the counting process over the interval
t
.
-
map_count_mean
Computes the mean of the counting process over multiple specified interval lengths for a given Markovian Arrival Process (MAP).This function calculates the mean number of events that occur in a MAP over each interval length provided in the array
t
. It uses the arrival rate of the MAP, denoted as lambda (λ), and multiplies it by each interval length. The results are returned in an array corresponding to the input intervals.- Parameters:
MAP
- The Markovian Arrival Process stored in a MatrixCell.t
- An array of interval lengths over which to compute the mean.- Returns:
- An array of doubles, where each element represents the mean of the counting process over the corresponding interval length in
t
.
-
map_count_var
Computes the variance of the counting process over a specified interval length for a given Markovian Arrival Process (MAP).This function calculates the variance in the number of events occurring in a MAP over an interval of length
t
. It uses the mean counting process function for a single interval length and retrieves the first element.- Parameters:
MAP
- The Markovian Arrival Process stored in a MatrixCell.t
- The length of the interval over which to compute the variance.- Returns:
- The variance of the counting process over the interval
t
.
-
map_count_var
Computes the variance of the counting process over multiple specified interval lengths for a given Markovian Arrival Process (MAP).This function calculates the variance in the number of events occurring in a MAP over each interval length provided in the array
t
. It employs the MAP's infinitesimal generator, stationary distribution, and other parameters to determine the variance. The results are returned in an array corresponding to the input intervals.- Parameters:
MAP
- The Markovian Arrival Process stored in a MatrixCell.t
- An array of interval lengths over which to compute the variance.- Returns:
- An array of doubles, where each element represents the variance of the counting process over the corresponding interval length in
t
.
-
map_rand
Generates a random Markovian Arrival Process (MAP) with 2 states.- Returns:
- a MatrixCell representing the random MAP transition matrices
-
map_randn
Generates a random Markovian Arrival Process (MAP) with 2 states using normal distribution with mean 1 and standard deviation 2.- Returns:
- a MatrixCell representing the random MAP transition matrices
-