afufs: Calculate Fu's Fs for arbitrary parameters - asymptotic...

Description Usage Arguments Details Value References Examples

View source: R/afufs.R

Description

Returns Fu's Fs statistic.

Usage

1
afufs(n, k, theta)

Arguments

n

The number of total sequences/individuals

k

The number of unique alleles

theta

The average pairwise nucleotide divergence

Details

Fu's Fs is a population genetics statistic that is useful for detecting loci that are responsible for population expansion, for example. Fu's Fs can be formulated as a calculation that involves Stirling numbers of the first kind. These can get large very quickly and exceed the floating point range for modern genomic data sets.

‘afufs' calculates Fu’s Fs using a single term asymptotic approximation This contrasts with 'hfufs' which uses a Stirling number approximator for each term. 'afufs' is therefore simultaneously more accurate and faster.

Value

Fu's Fs

References

Chen, S.L. and Temme, N. (2020) Computing sums of Stirling numbers of the first kind: Application to population genetics statistics. In preparation.

Examples

1
2
3
4
5
n <- 100
k <- 30
theta <- 12.345
afufs(n, k, theta)
# -0.7368616

swainechen/hfufs documentation built on June 22, 2020, 7:02 a.m.