PhaseTypeR: an R package for phase-type distributions in population genetics

Iker Rivas-González*, Lars Nørvang Andersen, Asger Hobolth

*Corresponding author for this work

Research output: Contribution to journal/Conference contribution in journal/Contribution to newspaperJournal articleResearchpeer-review

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.
Original languageEnglish
JournalThe Journal of Open Source Software
Volume8
Issue82
DOIs
Publication statusPublished - Feb 2023

Fingerprint

Dive into the research topics of 'PhaseTypeR: an R package for phase-type distributions in population genetics'. Together they form a unique fingerprint.

Cite this