View source: R/structured_coal.R
structured_coal.simulate | R Documentation |
Simulate expansion structured coalescent Population size must be locally smooth around divergence time and must reach 0 at divergence time !! Note: This simulation relies on inverse transform sampling and numerical inverses of Neg.rate.ints
structured_coal.simulate(
sampling_times,
colours,
div_times,
div_events,
Neg.rates,
Neg.rate.ints,
div.from = NA
)
sampling_times |
Nx1 times of leaves. |
colours |
Nx1 colour assignment of leaves |
div_times |
Kx1 divergence times for colours, neutral colour must diverge at -Inf. MUST BE IN DESCENDING ORDER |
div_events |
Kx1 colour assignment for divergence times, i.e. which colour corresponds to which divergence time |
Neg.rates |
Kx1 List of Functions (t)->(R+). 1/Neg(t) for each colour. |
Neg.rate.ints |
Kx1 List of Functions (t, s)->(R+). int_t^s 1/Neg(tau),d tau for each colour |
div.from |
Kx1 List of integers denoting parents of diverging lineages. If NA parents will be randomised |
A list consisting of the simulate coalescent times coalescent_times
and the log-likelihood of the simulation log_likelihood
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.