This function simulates a punctuated change that is is protracted enough that it is captured by multiple transitional populations. Trait evolution starts in stasis, shifts to a general random walk, and then shifts back into stasis.
sim.sgs(
ns = c(20, 20, 20),
theta = 0,
omega = 1,
ms = 1,
vs = 0.1,
nn = rep(30, sum(ns)),
tt = 0:(sum(ns) - 1),
vp = 1
)
a paleoTS
object
vector with the number of samples in each segment
trait mean for initial stasis segment
trait variance for stasis segments
step mean during random walk segment
step variance during random walk segment
vector of sample sizes for each population
vector of times (ages) for each population
phenotypic trait variance for each population
Trait evolution proceeds in three segments: Stasis, General random walk, stasis (sgs).
The initial stasis segment has a mean of theta
and variance omega
before
shifting in the second segment to a general random walk with parameters ms
and
vs
. Finally, the third segment is a return to stasis, centered around the trait value
of the last population of the random walk.
x <- sim.sgs() # default values OK
plot(x)
Run the code above in your browser using DataLab