sim.GRW: Simulate random walk or directional time-series for trait...

sim.GRWR Documentation

Simulate random walk or directional time-series for trait evolution

Description

Simulate random walk or directional time-series for trait evolution

Usage

sim.GRW(ns = 20, ms = 0, vs = 0.1, vp = 1, nn = rep(20, ns), tt = 0:(ns - 1))

Arguments

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)

Details

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.

Value

a paleoTS object

Note

This function simulates an unbiased random walk if ms is equal to zero and a general (or biased) random walk otherwise.

See Also

sim.Stasis, sim.OU, as.paleoTS

Examples

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)

paleoTS documentation built on Sept. 11, 2024, 9:18 p.m.