Tools for Discrete Phase-Type Distributions (butools.dph)

To load this package, either start the BuToolsInit script, or execute

addpath('butools/dph') in Matlab,
<<BuTools`DPH` in Mathematica,
from butools.dph import * in Python/Numpy.

Discrete phase-type and matrix-geometric distributions

Discrete time phase-type (DPH) distributions are characterized by two parameters, the initial probability vector \(\alpha\) and the transition probability matrix of a transient discrete time Markov chain \(\alpha\). The DPH distribution represents the absorption time of this transient Markov chain starting from \(\alpha\). The cummulative distribution function (cdf) of DPH distributions is

\[F_{PH}(k) = P(\mathcal{X}_{PH}\leq k) = 1-\alpha A^k \mathbf{1},\]

where \(\mathbf{1}\) is the column vector of ones.

Matrix geometric (MG) distributions are the generalizations of DPH distributions. Formally, the cdf and all the related formulas for the statistical quantities are very similar to the ones of DPH distributions

\[F_{MG}(t) = P(\mathcal{X}_{MG}\leq k) = 1-\mathbf{b} B^k \mathbf{e},\]

however, \(\mathbf{b},B\) and \(\mathbf{e}\) can hold general numbers, the entries do not have to be valid probabilities. MG distributions therefore lack the simple stochastic interpretation that DPH distributions have. Vector \(\mathbf{b}\) is called “starting operator”, matrix \(B\) is the “process rate operator” and vector \(\mathbf{e}\) is the “summing operator”.

BuTools provides several tools for both distribution classes in the dph package. However, BuTools uses a special form of MG distributions, where the summing operator is a vector of ones, thus \(\mathbf{e}=\mathbf{1}\). This is not a restriction, as all MG distributions defined with general summing operator can be easily transformed to this representation. Assume we have an MG distribution in the general form with parameters \(\mathbf{b}, B, \mathbf{e}\). The necessary similarity transform is obtained by calling the T = TransformToOnes(e) procedure of the BuTools reptrans package. The parameters of the MG distribution used by all related BuTools tools can be calculated by \(\mathbf{b'}=\mathbf{b}T^{-1}\) and \(B'=T\,B\,T^{-1}\).

Simple statistical properties and tools

MomentsFromMG Returns the moments of a matrix geometric distribution.
MomentsFromDPH Returns the moments of a discrete phase-type distribution.
CdfFromMG Returns the cummulative distribution function of a matrix-geometric distribution.
CdfFromDPH Returns the cummulative distribution function of a discrete phase-type distribution.
PmfFromMG Returns the probability mass function of a matrix-geometric distribution.
PmfFromDPH Returns the probability mass function of a discrete phase-type distribution.
RandomDPH Returns a random discrete phase-type distribution with a given mean value.
CheckDPHRepresentation Checks if the given vector and matrix define a valid discrete phase-type representation.
CheckMGRepresentation Checks if the given vector and matrix define a valid matrix-geometric representation.
SamplesFromDPH Generates random samples from a discrete phase-type distribution.
ImageFromDPH Depicts the given discrete phase-type distribution, and either displays it or saves it to file.

Inverse characterization tools

DPH2From3Moments Returns an order-2 discrete phase-type distribution which has the same 3 moments as given.
DPH3From5Moments Returns an order-3 discrete phase-type distribution which has the same 5 moments as given.
MGFromMoments Creates a matrix-geometric distribution that has the same moments as given.

Representation transformation methods

AcyclicDPHFromMG Transforms a matrix-geometric representation to an acyclic DPH representation of the same size, if possible.
CanonicalFromDPH2 Returns the canonical form of an order-2 discrete phase-type distribution.
CanonicalFromDPH3 Returns the canonical form of an order-3 discrete phase-type distribution.
DPHFromMG Obtains a Markovian representation of a matrix geometric distribution of the same size, if possible.