title: Matrix-exponential distribution
text: # Matrix-exponential distribution
  
  In probability theory, the matrix-exponential distribution is an absolutely continuous distribution with rational Laplace–Stieltjes transform. They were first introduced by David Cox in 1955 as distributions with rational Laplace–Stieltjes transforms.
  
  The probability density function is $f(x)=\mathbf {\alpha } e^{x\,T}\mathbf {s} {\text{ for }}x\geq 0$ (and 0 when x < 0), and the cumulative distribution function is $F(t)=1-\alpha e^{{\textbf {A}}t}{\textbf {1}}$ where 1 is a vector of 1s and
  
      ${\begin{aligned}\alpha &\in \mathbb {R} ^{1\times n},\\T&\in \mathbb {R} ^{n\times n},\\s&\in \mathbb {R} ^{n\times 1}.\end{aligned}}$
  
  There are no restrictions on the parameters α, T, s other than that they correspond to a probability distribution. There is no straightforward way to ascertain if a particular set of parameters form such a distribution. The dimension of the matrix T is the order of the matrix-exponential representation.
  
  The distribution is a generalisation of the phase-type distribution.
  
  ## Moments
  
  If X has a matrix-exponential distribution then the kth moment is given by
  
      $\operatorname {E} (X^{k})=(-1)^{k+1}k!\mathbf {\alpha } T^{-(k+1)}\mathbf {s} .$
  
  ## Fitting
  
  Matrix exponential distributions can be fitted using maximum likelihood estimation.
  
  ## Software
  
  * BuTools a MATLAB and Mathematica script for fitting matrix-exponential distributions to three specified moments.
  