Abstract
Phase-type distributions describe the time until absorption of a continuous or discrete-time
Markov chain (Bladt & Nielsen, 2017). The probabilistic properties of phase-type distributions
(i.e., the probability density function, cumulative distribution function, quantile function,
moments and generating functions) are well-described and analytically tractable using matrix
manipulations.
Phase-type distributions have traditionally been used in actuarial sciences and queuing theory,
and, more recently, in population genetics. In order to facilitate the use of phase-type theory
in population genetics, we present PhaseTypeR, a general-purpose and user-friendly R (R Core
Team, 2021) package which contains all key functions —mean, (co)variance, probability density
function, cumulative distribution function, quantile function and random sampling— for both
continuous and discrete phase-type distributions. Importantly, univariate and multivariate
reward transformations are implemented for continuous and discrete phase-type distributions.
Multivariate reward transformations have great potential for applications in population genetics,
and we have included two examples. The first is concerned with the easy calculation of the
variance-covariance matrix for the site frequency spectrum (SFS) of the 𝑛-coalescent, and
the second is concerned with the correlation between tree heights in the two-locus ancestral
recombination graph.
Markov chain (Bladt & Nielsen, 2017). The probabilistic properties of phase-type distributions
(i.e., the probability density function, cumulative distribution function, quantile function,
moments and generating functions) are well-described and analytically tractable using matrix
manipulations.
Phase-type distributions have traditionally been used in actuarial sciences and queuing theory,
and, more recently, in population genetics. In order to facilitate the use of phase-type theory
in population genetics, we present PhaseTypeR, a general-purpose and user-friendly R (R Core
Team, 2021) package which contains all key functions —mean, (co)variance, probability density
function, cumulative distribution function, quantile function and random sampling— for both
continuous and discrete phase-type distributions. Importantly, univariate and multivariate
reward transformations are implemented for continuous and discrete phase-type distributions.
Multivariate reward transformations have great potential for applications in population genetics,
and we have included two examples. The first is concerned with the easy calculation of the
variance-covariance matrix for the site frequency spectrum (SFS) of the 𝑛-coalescent, and
the second is concerned with the correlation between tree heights in the two-locus ancestral
recombination graph.
Original language | English |
---|---|
Journal | The Journal of Open Source Software |
Volume | 8 |
Issue | 82 |
DOIs | |
Publication status | Published - Feb 2023 |