Class RAP

All Implemented Interfaces:
Serializable, Copyable

public class RAP extends Markovian
A Rational Arrival Process (RAP) distribution. RAP is a generalization of the Markovian Arrival Process (MAP) where the matrices H0 and H1 represent hidden and visible transitions respectively, but with relaxed constraints compared to MAP. Representation: - H0: matrix of hidden transition rates (transitions without arrivals) - H1: matrix of visible transition rates (transitions with arrivals) - H0 + H1 must form a valid infinitesimal generator (row sums = 0) - All eigenvalues of H0 must have negative real parts - Dominant eigenvalue of H0 must be negative and real The marginal distribution of inter-arrival times is a Matrix Exponential (ME) distribution.
See Also:
  • Constructor Details

    • RAP

      public RAP(Matrix H0, Matrix H1)
      Creates a Rational Arrival Process with specified H0 and H1 matrices.
      Parameters:
      H0 - matrix of hidden transition rates (square matrix)
      H1 - matrix of visible transition rates (square matrix, same size as H0)
      Throws:
      IllegalArgumentException - if the representation is invalid
  • Method Details

    • getH0

      public Matrix getH0()
      Gets the H0 matrix (hidden transition rates).
      Returns:
      the H0 matrix
    • getH1

      public Matrix getH1()
      Gets the H1 matrix (visible transition rates).
      Returns:
      the H1 matrix
    • getNumberOfPhases

      public long getNumberOfPhases()
      Description copied from class: Markovian
      Gets the number of phases in this Markovian distribution.
      Overrides:
      getNumberOfPhases in class Markovian
      Returns:
      the number of phases
    • getProcess

      public MatrixCell getProcess()
      Description copied from class: Markovian
      Gets the matrix representation of this Markovian process.
      Overrides:
      getProcess in class Markovian
      Returns:
      MatrixCell containing D0, D1, ... matrices
    • fitMomentsAndCorrelations

      public static RAP fitMomentsAndCorrelations(double[] moments, double[] correlations)
      Creates a RAP by fitting the given moments and correlations. Uses BuTools RAPFromMomentsAndCorrelations algorithm if available.
      Parameters:
      moments - array of moments
      correlations - array of lag-k correlations
      Returns:
      a RAP matching the given moments and correlations
      Throws:
      UnsupportedOperationException - if fitting algorithm is not yet implemented
    • fitMoments

      public static RAP fitMoments(double[] moments)
      Creates a RAP by fitting the given moments. Uses BuTools RAPFromMoments algorithm if available.
      Parameters:
      moments - array of moments
      Returns:
      a RAP matching the given moments
      Throws:
      UnsupportedOperationException - if fitting algorithm is not yet implemented
    • fromMAP

      public static RAP fromMAP(MAP map)
      Creates a RAP from a Markovian Arrival Process (MAP). This shows that MAP is a special case of RAP.
      Parameters:
      map - the MAP to convert to RAP
      Returns:
      a RAP equivalent to the given MAP
    • fromPoisson

      public static RAP fromPoisson(double rate)
      Creates a RAP from an exponential renewal process (Poisson process).
      Parameters:
      rate - the arrival rate (lambda)
      Returns:
      a RAP representing a Poisson process
    • fromErlang

      public static RAP fromErlang(int k, double rate)
      Creates a RAP from an Erlang renewal process.
      Parameters:
      k - number of phases
      rate - rate parameter for each phase
      Returns:
      a RAP representing an Erlang renewal process
    • fromHyperExp

      public static RAP fromHyperExp(double p, double lambda1, double lambda2)
      Creates a RAP from a Hyper-exponential distribution.
      Parameters:
      p - probability of using the first phase
      lambda1 - rate parameter for the first phase
      lambda2 - rate parameter for the second phase
      Returns:
      a RAP representing a Hyper-exponential renewal process
    • fitMeanAndSCV

      public static RAP fitMeanAndSCV(double mean, double scv)
      Creates a RAP by fitting the given mean and squared coefficient of variation (SCV). Uses Erlang fitting for SCV invalid input: '<' 1 and HyperExp fitting for SCV >= 1.
      Parameters:
      mean - target mean inter-arrival time
      scv - target squared coefficient of variation
      Returns:
      a RAP matching the given mean and SCV