sim.GRW.shift | R Documentation |
Simulate (general) random walk with shift(s) in generating parameters
sim.GRW.shift(
ns = c(10, 10),
ms = c(0, 1),
vs = c(0.5, 0.5),
nn = rep(30, sum(ns)),
tt = 0:(sum(ns) - 1),
vp = 1
)
ns |
vector of the number of samples in each segment |
ms |
vector of mean step parameter in each segment |
vs |
vector of step variance parameter in each segment |
nn |
vector of sample sizes, one for each population |
tt |
vector of samples times (ages) |
vp |
phenotypic variance in each sample |
Simulates under a model in which a sequence is divided into two or more segments.
Trait evolution proceeds as a general random walk, with each segment getting its own
generating parameters (mstep
, vstep
).
a paleoTS
object with the simulated time-series
sim.GRW
, sim.sgs
, opt.GRW.shift
x <- sim.GRW.shift(ns = c(10,10,10), ms = c(0, 1, 0), vs = c(0.1,0.1,0.1))
plot(x)
abline(v = c(9.5, 19.5), lty = 3, lwd = 2, col = "blue") # shows where dynamics shift
text (c(5, 15, 25), c(2,2,2), paste("segement", 1:3, sep =" "), col = "blue")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.