View source: R/sim.coalescent.R
| proba.coalescent | R Documentation |
This function calculates the probability that two lineages coalesce
out of a sample of size n in a population of size N after
t generations.
proba.coalescent(t, N = 1e4, n = 2, exact = TRUE)
t |
a vector of generations (rounded to integers if needed). |
N |
the size of population (10,000 by default). |
n |
the sample size (2 by default). |
exact |
a logical value specifying whether exact calculation should be done or an approximation (Hudson, 1991, eq. 3). |
Emmanuel Paradis
Hudson, R. R. (1991). Gene genealogies and the coalescent process. Oxford Surveys in Evolutionary Biology, 7, 1–44.
proba.coalescent(1:10)
## the approximate formula doesn't work well when n is
## not small compared to N:
proba.coalescent(1, 100, 50, exact = FALSE)
proba.coalescent(1, 100, 50)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.