Learn R Programming

seedy (version 1.3)

estcoaltime: Estimate expected time to coalescence for sampled lineages in bottlenecked population

Description

Estimates the expected time to coalescence for two randomly sampled lineages at a particular time, given the past population dynamics.

Usage

estcoaltime(bottlesize, popsize, bottletimes, obstime)

Arguments

bottlesize
Effective size of population bottlenecks.
popsize
Effective population size between bottlenecks.
bottletimes
Vector of bottleneck times.
obstime
Time of observation.

Value

  • Returns the expected number of generations since coalescence.

Details

Expected coalescent time is calculated under the assumption that population remains constant at popsize, but drops to bottlesize for a single generation at bottleneck times. The probability of coalescence in a particular generation is the reciprocal of the population size at the time.

Examples

Run this code
estcoaltime(bottlesize=10, popsize=10000, bottletimes=c(1000,2000,3000,4000), 
            obstime=5000)

Run the code above in your browser using DataLab