Description Usage Arguments Value Examples
View source: R/removal_tree_sampling_aux.R
Simulates a trajectory of the population size under a constant-rate birth-death model as well as the removal vector y (y_i=1 iff s_i is removed upon sampling). It uses Gillespie algorithm to simulate portions of trajectory in the time intervals between removals.
1 | trajectory(lambda, mu, r, sampling_times)
|
lambda |
birth rate |
mu |
death rate |
r |
removal probability, the probability for an individual to be removed upon sampling |
sampling_times |
vector containing the sampling times (s_j)_{j=1...k} in increasing order |
an object of the class trajectory
, containing:
t
a sequence of time points (t_i)_{i=1...n} with t_1=0 and t_n=s_k,
N
a sequence of population size values where N_i is the value on the interval [t_i,t_{i+1}), and
removed
a vector with the sampling times of removed samples.
1 | trajectory(lambda=2, mu=1, r=0.2, sampling_times=c(1,2))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.