Learn R Programming

phylodyn (version 0.9.0)

coalsim: Simulate from inhomogeneous, heterochronous coalescent

Description

Simulate from inhomogeneous, heterochronous coalescent

Usage

coalsim(samp_times, n_sampled, traj, method = "tt", val_upper = 10,
  lower_bound = 1, ...)

Arguments

samp_times
numeric vector of sampling times.
n_sampled
numeric vector of samples taken per sampling time.
traj
function that returns effective population size at time t.
method
which sampling method to use. "tt" invoke time-transformation method, "thin" invokes thinning method.
val_upper
numeric used by time-transformation method to set a starting point for its dynamic numerical integration upper bound.
lower_bound
numeric lower limit of traj function on its support. Used only by thinning method.
...
additional arguments to be passed to traj function.

Value

A list containing vectors of coalescent times coal_times, intercoalescent times intercoal_times, and number of active lineages lineages, as well as passing along samp_times and n_sampled.

Examples

Run this code
coalsim(0:2, 3:1, unif_traj, lower_bound=10)

Run the code above in your browser using DataLab