estcoaltime: Estimate expected time to coalescence for sampled lineages in...

Description Usage Arguments Details Value Examples

View source: R/estcoaltime.R

Description

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

Usage

1
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.

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.

Value

Returns the expected number of generations since coalescence.

Examples

1
2
estcoaltime(bottlesize=10, popsize=10000, bottletimes=c(1000,2000,3000,4000), 
            obstime=5000)

seedy documentation built on May 29, 2017, 10:58 a.m.