Class ME

All Implemented Interfaces:
Serializable, Copyable

public class ME extends Markovian
A Matrix Exponential (ME) distribution. ME distributions are characterized by an initial vector alpha and a matrix parameter A. They generalize Phase-Type (PH) distributions by allowing alpha to have entries outside [0,1] and A to have arbitrary structure (not necessarily a valid sub-generator). Representation: - alpha: initial vector (may have negative entries or sum != 1) - A: matrix parameter (must have all eigenvalues with negative real parts) - Dominant eigenvalue of A must be negative and real The distribution function is: F(t) = 1 - alpha * exp(A*t) * e (under certain conditions) Moments: m_k = k! * alpha * (-A)^(-k) * e
See Also:
  • Constructor Details

    • ME

      public ME(Matrix alpha, Matrix A)
      Creates a Matrix Exponential distribution with specified initial vector and matrix parameter.
      Parameters:
      alpha - the initial vector (row vector as Matrix)
      A - the matrix parameter (must be square with negative real eigenvalues)
      Throws:
      IllegalArgumentException - if the representation is invalid
  • Method Details

    • getAlpha

      public Matrix getAlpha()
      Gets the initial vector alpha.
      Returns:
      the initial vector as a Matrix
    • getA

      public Matrix getA()
      Gets the matrix parameter A.
      Returns:
      the matrix parameter A
    • 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
    • fitMoments

      public static ME fitMoments(double[] moments)
      Creates an ME distribution by fitting the given moments. Uses BuTools MEFromMoments algorithm.
      Parameters:
      moments - array of moments (requires 2*M-1 moments for order M ME distribution)
      Returns:
      an ME distribution matching the given moments
      Throws:
      IllegalArgumentException - if moments are invalid or fitting fails
    • fromExp

      public static ME fromExp(double rate)
      Creates an ME distribution from an exponential distribution. This is a convenience method showing that Exp is a special case of ME.
      Parameters:
      rate - the rate parameter (lambda)
      Returns:
      an ME distribution equivalent to Exp(rate)
    • fromErlang

      public static ME fromErlang(int k, double rate)
      Creates an ME distribution from an Erlang distribution. This is a convenience method showing that Erlang is a special case of ME.
      Parameters:
      k - number of phases
      rate - rate parameter for each phase
      Returns:
      an ME distribution equivalent to Erlang(k, rate)
    • fromHyperExp

      public static ME fromHyperExp(double[] p, double[] rates)
      Creates an ME distribution from a HyperExponential distribution. This is a convenience method showing that HyperExp is a special case of ME.
      Parameters:
      p - array of probabilities for each branch
      rates - array of rates for each branch
      Returns:
      an ME distribution equivalent to HyperExp(p, rates)