LAPM.phase_type

Module for phase-type distribution.

\(T\) is supposed to be a phase-type distributed random variable.

Functions

cum_dist_func(beta, B, Qt)

Return the (symbolic) cumulative distribution function of phase-type.

density(beta, B, Qt)

Return the (symbolic) probability density function of the phase-type distribution.

expected_value(beta, B)

Return the (symbolic) expected value of the phase-type distribution.

laplace(beta, B)

Return the symbolic Laplacian of the phase-type distribtion.

nth_moment(beta, B, n)

Return the (symbolic) n th moment of the phase-type distribution.

standard_deviation(beta, B)

Return the (symbolic) standard deviation of the phase-type distribution.

variance(beta, B)

Return the (symbolic) variance of the phase-type distribution.

z(B)

Return the (symbolic) vector of rates toward absorbing state.

Detailed module content

LAPM.phase_type.cum_dist_func(beta, B, Qt)[source]

Return the (symbolic) cumulative distribution function of phase-type.

Parameters
  • beta (SymPy dx1-matrix) – initial distribution vector

  • B (SymPy dxd-matrix) – transition rate matrix

  • Qt (SymPy dxd-matrix) – Qt = \(e^{t\,B}\)

Returns

cumulative distribution function of PH(\(\beta\), \(B\))

\(F_T(t) = 1 - \mathbf{1}^T\,e^{t\,B}\,\beta\)

Return type

SymPy expression

LAPM.phase_type.density(beta, B, Qt)[source]

Return the (symbolic) probability density function of the phase-type distribution.

Parameters
  • beta (SymPy dx1-matrix) – initial distribution vector

  • B (SymPy dxd-matrix) – transition rate matrix

  • Qt (SymPy dxd-matrix) – Qt = \(e^{t\,B}\)

Returns

probability density function of PH(\(\beta\), \(B\))

\(f_T(t) = z^T\,e^{t\,B}\,\beta\)

Return type

SymPy expression

See also

z(): Return the (symbolic) vector of external output rates.

LAPM.phase_type.expected_value(beta, B)[source]

Return the (symbolic) expected value of the phase-type distribution.

Parameters
  • beta (SymPy dx1-matrix) – initial distribution vector

  • B (SymPy dxd-matrix) – transition rate matrix

Returns

expected value of PH(\(\beta\), \(B\))

\(\mathbb{E}[T] = -\mathbf{1}^T\,B^{-1}\,\beta\)

Return type

SymPy expression

LAPM.phase_type.laplace(beta, B)[source]

Return the symbolic Laplacian of the phase-type distribtion.

Parameters
  • beta (SymPy dx1-matrix) – initial distribution vector

  • B (SymPy dxd-matrix) – transition rate matrix

Returns

Laplace transform of the probability density of PH(\(\beta\), \(B\))

\(L_T(s)=\) \(z^T\,(s\,I-B)^{-1}\,\beta\)

Return type

SymPy expression

See also

z(): Return the (symbolic) vector of external output rates.

LAPM.phase_type.nth_moment(beta, B, n)[source]

Return the (symbolic) n th moment of the phase-type distribution.

Parameters
  • beta (SymPy dx1-matrix) – initial distribution vector

  • B (SymPy dxd-matrix) – transition rate matrix

  • n (positive int) – order of the moment

Returns

n th moment of PH(\(\beta\), \(B\))

\(\mathbb{E}[T^n]=\) \((-1)^n\,n!\,\mathbf{1}^T\,B^{-1}\,\beta\)

Return type

SymPy expression

LAPM.phase_type.standard_deviation(beta, B)[source]

Return the (symbolic) standard deviation of the phase-type distribution.

Parameters
  • beta (SymPy dx1-matrix) – initial distribution vector

  • B (SymPy dxd-matrix) – transition rate matrix

Returns

standard deviation of PH(\(\beta\), \(B\))

\(\sigma(T) = \sqrt{\sigma^2(T)}\)

Return type

SymPy expression

See also

variance(): Return the (symbolic) variance of the phase-type

distribution.

LAPM.phase_type.variance(beta, B)[source]

Return the (symbolic) variance of the phase-type distribution.

Parameters
  • beta (SymPy dx1-matrix) – initial distribution vector

  • B (SymPy dxd-matrix) – transition rate matrix

Returns

variance of PH(\(\beta\), \(B\))

\(\sigma^2(T) = \mathbb{E}[T^2] - (\mathbb{E}[T])^2\)

Return type

SymPy expression

See also

expected_value(): Return the (symbolic) expected value of the phase-type distribution.
nth_moment(): Return the (symbolic) nth moment of the phase-type distribution.
LAPM.phase_type.z(B)[source]

Return the (symbolic) vector of rates toward absorbing state.

Parameters

B (SymPy dxd-matrix) – compartment matrix

Returns

\(z = -B^T\,\mathbf{1}\)

Return type

SymPy dx1-matrix