The function calculates the pairwise difference based on the site frequency spectrum.

pairwDiff(SFS)

Arguments

SFS

vector with the site frequency spectrum.

Value

The pairwise difference.

Details

See SFS for explanation of the site frequency spectrum.

If one runs pairwDiff with a vector that contains anything other than natural numbers, an error will occur.

For details about the pairwise difference, consult the analyzeDNA vignette.

References

Wakeley J. (2009) Coalescent Theory: An Introduction. Colorado: Roberts and Company Publishers.

Examples

pairwDiff(c(2,1,0,0))
#> [1] 1.4