sim.GRW.shift: Simulate (general) random walk with shift(s) in generating...

sim.GRW.shiftR Documentation

Simulate (general) random walk with shift(s) in generating parameters

Description

Simulate (general) random walk with shift(s) in generating parameters

Usage

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
)

Arguments

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

Details

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).

Value

a paleoTS object with the simulated time-series

See Also

sim.GRW, sim.sgs, opt.GRW.shift

Examples

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")

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