| sim.GRW | R Documentation | 
Simulate random walk or directional time-series for trait evolution
sim.GRW(ns = 20, ms = 0, vs = 0.1, vp = 1, nn = rep(20, ns), tt = 0:(ns - 1))
| ns | number of populations in the sequence | 
| ms | mean of evolutionary "steps" | 
| vs | variance of evolutionary "steps" | 
| vp | phenotypic variance within populations | 
| nn | vector of population sample sizes | 
| tt | vector of population times (ages) | 
The general random walk model considers time in discrete steps.
At each time step, an evolutionary change is drawn at random from a distribution of
possible evolutionary "steps."  It turns out that the long-term dynamics of an evolving
lineage depend only on the mean and variance of this step distribution.  The former,
mstep, determined the directionality in a sequence and the latter, vstep,
determines its volatility.
a paleoTS object
This function simulates an unbiased random walk if ms is  equal to zero and
a general (or biased) random walk otherwise.
sim.Stasis, sim.OU, as.paleoTS
x.grw <- sim.GRW(ms = 0.5)
x.urw <- sim.GRW(ms = 0)
plot(x.grw, ylim = range(c(x.grw$mm, x.urw$mm)))
plot(x.urw, add = TRUE, col = "blue")
legend(x = "topleft", c("GRW", "URW"), col = c("black", "blue"), lty = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.