SiteFrequencies: Site frequency spectrum

Description Usage Arguments Details Value Source See Also Examples

View source: R/DocumentationSiteFrequencies.R

Description

Finding the distribution of the site frequencies, the number of segregating sites and the tail statistics using phase-type distributions.

Usage

1
2
SiteFrequencies(n, lambda, i = NULL, nSegSites = FALSE,
  tailStat = FALSE)

Arguments

n

the sample size (>=3)

lambda

the non-negative mutation rate

i

either the number of the site frequency that should be considered or the number of the first term of the tail statistic. In both cases 1 <= i <= n-1.

nSegSites

a logical value indicating whether the function should compute the distribution of the number of segregating sites (S_{Total} = ξ_1 + ... + ξ_{n-1}). If TRUE, any value of i will be ignored. Defaults to FALSE.

tailStat

a logical value indicating whether the function should compute the distribution of the tail statistic ( S_{i+} = ξ_i +...+ ξ_{n-1}). If TRUE, i will determine the first term of this statistic. Defaults to FALSE.

Details

This function can be used to compute the discrete phase-type representation of the site frequencies ξ_i + 1, for all i in eqn1,...,n-1, the total number of segregating sites S_{Total} + 1 and the tail statistic S_{i+} + 1. The reason for adding one to the site frequency is that the support for discrete phase-type distributions is on the natural numbers excluding zero. Hence, immediate absorption would not be possible. By adding one, we allow the site frequency to be zero. Note that the package does also include the function dSegregatingSites, which computes the density function of the number of segregating sites for a given sample size n, a mutation parameter θ and a non-negative vector of quantiles k.

Value

If nSegSites = FALSE and tailStat= FALSE, the function returns the phase-type representation of the i'th site frequency (ξ_i) plus one. If nSegSites = TRUE, the function returns the phase-type representation of the total number of segregating sites plus one, and if tailStat= TRUE, the representation of the tail statistic (which first term is determined by i) plus one is returned. In all three cases, the returned object is of type discphasetype.

Source

Asger Hobolth, Arno Siri-Jégousse, Mogens Bladt (2019): Phase-type distributions in population genetics. Theoretical Population Biology, 127, pp. 16-32.

See Also

dSegregatingSites

Examples

1
2
3
SiteFrequencies(n=4, lambda=1, i=2)
SiteFrequencies(n=4, lambda=1, nSegSites=TRUE)
SiteFrequencies(n=4, lambda=1, i=2, tailStat=TRUE)

aumath-advancedr2019/PhaseTypeGenetics documentation built on Dec. 3, 2019, 7:16 a.m.