The PhaseTypeGenetics package provides several functions to compute properties of the discrete and continous phase-type distribution. These functions are

  • contphasetype

  • discphasetype

  • dphasetype

  • maxima

  • phmean

  • minima

  • moments

  • pphasetype

  • qphasetype

  • rphasetype

  • phsum

  • summary

  • phvar

Furthermore, the package includes some functions that are useful in connection to population genetics. These functions are

  • BlockCountProcess

  • discretization

  • dSegregatingSites

  • RewTransDistribution

  • SiteFrequencies,

The function BlockCountProcess computes the state space and the corresponding rate matrix for the block counting process for a given sample size \(n\) in the standard coalescent model. The function discretization discretizes a continuous phase-type distribution, and can for example be used to obtain the distribution of the number of segregating sites, when the mutation rate is known and equal to \(\lambda\). dSegregatingSites computes the distribution of the number of segregating sites for a given sample size and a given mutation rate. RewTransDistribution is an implementation of the reward transformation and can be used to obtain the distribution of the total branch length. Finally, the function Site Frequencies computes the distribution of the site frequencies, the number of segregating sites and the tail statistics using phase-type theory.

PhaseTypeGenetics general functions

PhaseTypeGenetics functions for applications in population genetics

Note that the functions BlockCountProcess, SiteFrequencies and dSegregatingSites make use of the package 'partitions'. Make sure to install this package to be able to use the functions.