Simulate fossils under a non-uniform model of preservation for a given set of consecutive time intervals
Simulate fossils under a non-uniform model of preservation for a given set of consecutive time intervals
Intervals can be specified by specifying the interval boundaries using interval.ages or specifying both max.age and strata. In the second scenario all intervals will be of equal length. Preservation can be specified using rates, which represent the rates of a Poisson process in each interval, or probabilities, which represent the probabilities of sampling per interval. When using probabilities, at most one fossil per species will be sampled per interval.
Fossils can be simulated for a phylo (tree) or taxonomy (taxonomy) object. If both are specified, the function uses taxonomy. If no taxonomic information is provided, the function assumes all speciation is symmetric (i.e. bifurcating, beta = 1).
fossils: Append fossils to to an existing fossils object.
interval.ages: Vector of stratigraphic interval ages, starting with the minimum age of the youngest interval and ending with the maximum age of the oldest interval.
max.age: Maximum age of the oldest stratigraphic interval.
strata: Number of stratigraphic intervals.
probabilities: Probability of sampling/preservation in each interval. The number of probabilities should match the number of intervals and the first entry should correspond to youngest interval.
rates: Poisson sampling rate for each interval. The number of rates should match the number of intervals and the first entry should correspond to youngest interval.
root.edge: If TRUE include the root edge. Default = TRUE.
use.exact.times: If TRUE use exact sampling times. If FALSE hmin and hmax will equal the start and end times of the corresponding interval. Default = TRUE.
Returns
An object of class fossils.
Examples
# simulate treet = ape::rtree(6)# assign a max age based on tree heightmax.age = tree.max(t)# simulate fossils using max.age and strata & probabilitiesstrata =4probability = rep(0.7,4)f = sim.fossils.intervals(t, max.age = max.age, strata = strata, probabilities = probability)plot(f, t, strata = strata, show.strata =TRUE)# simulate fossils using interval.ages & ratestimes = c(0, sort(runif(3, min =0, max = max.age)), max.age)rates = c(5,0,5,0)f = sim.fossils.intervals(t, interval.ages = times, rates = rates)plot(f, t, interval.ages = times, show.strata =TRUE)# simulate fossils using taxonomys = sim.taxonomy(t,0.1,0.1,1)f = sim.fossils.intervals(taxonomy = s, interval.ages = times, rates = rates)plot(f, t, interval.ages = times, show.strata =TRUE)# append fossils to an existing fossils objectnew.rates = rates *2f2 = sim.fossils.intervals(taxonomy = s, fossils = f, interval.ages = times, rates = new.rates)