MyNixOS website logo
Description

Inference for Phase-Type Distributions.

Functions to perform Bayesian inference on absorption time data for Phase-type distributions. The methods of Bladt et al (2003) <doi:10.1080/03461230110106435> and Aslett (2012) <https://www.louisaslett.com/PhD_Thesis.pdf> are provided.

PhaseType R package :package:

Project Status: Active - The project has reached a stable, usable state and is being actively developed. license metacran version metacran downloads PhaseType status badge

This is a package for working with Phase-type (PHT) distributions in the R programming language. The entire of the MCMC portion of the code has been written in optimised C for higher performance and very low memory use, whilst being easy to call from wrapper R functions.

Definition of a Phase-type Distribution

Consider a continuous-time Markov chain (CTMC) on a finite discrete state space of size $n+1$, where one of the states is absorbing. Without loss of generality the generator of the chain can be written in the form:

$$\mathbf{T} = \left( \begin{array}{cc} \mathbf{S} & \mathbf{s} \
\mathbf{0}^\mathrm{T} & 0 \end{array} \right)$$

where $\mathbf{S}$ is the $n \times n$ matrix of transition rates between non-absorbing states; $\mathbf{s}$ is an $n$ dimensional vector of absorption rates; and $\mathbf{0}$ is an $n$ dimensional vector of zeros. We take $\boldsymbol{\pi}$ as the initial state distribution: an $n$ dimensional vector of probabilities $\left(\sum_i \pi_i=1\right)$ such that $\pi_i$ is the probability of the chain starting in state $i$.

Then, we define a Phase-type distribution to be the distribution of the time to absorption of the CTMC with generator $\mathbf{T}$, or equivalently as the first passage time to state $n+1$. Thus, a Phase-type distribution is a positively supported univariate distribution having distribution and density functions:

$$\begin{array}{rcl} F_X(x) &=& 1 - \boldsymbol{\pi}^\mathrm{T} \exp\{x \mathbf{S}\} \mathbf{e}\
f_X(x) &=& \boldsymbol{\pi}^\mathrm{T} \exp\{x \mathbf{S}\} \mathbf{s} \end{array} \qquad \mbox{for } x \in [0,\infty)$$

where $\mathbf{e}$ is an $n$ dimensional vector of $1$'s; $x$ is the time to absorption (or equivalently first-passage time to state $n+1$); and $\exp\{x \mathbf{S}\}$ is the matrix exponential. We denote that a random variable $X$ is Phase-type distributed with parameters $\boldsymbol{\pi}$ and $\mathbf{T}$ by $X \sim \mathrm{PHT}(\boldsymbol{\pi},\mathbf{T})$.

Note that $\displaystyle \sum_{j=1}^n S_{ij} = -s_i \ \forall\,i$, so often a Phase-type is defined merely by providing $\mathbf{S}$, $\mathbf{T}$ then being implicitly known.

Contact

Please feel free to:

Install

You can install the latest release directly from CRAN.

install.packages("PhaseType")

Install development version (not recommended)

You can get the very latest version from R-universe:

install.packages("PhaseType", repos = c("https://louisaslett.r-universe.dev", "https://cloud.r-project.org"))

Installing directly from GitHub is not supported by the install.packages command, but if you wish to compile from source then you could use the devtools package:

install.packages("remotes")
remotes::install_github("louisaslett/PhaseType")

Under releases, the tree/commit from which CRAN releases were made are recorded, so historic source can be downloaded from there.

Citation

If you use this software, please use the following citation:

Aslett, L. J. M. (2012), MCMC for Inference on Phase-type and Masked System Lifetime Models, PhD thesis, Trinity College Dublin.

@phdthesis{Aslett2012,
  title={MCMC for Inference on Phase-type and Masked System Lifetime Models},
  author={Aslett, L. J. M.},
  year={2012},
  school={Trinity College Dublin}
}

Thank-you :smiley:

Metadata

Version

0.3.0

License

Unknown

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows