Learn R Programming

evoTS (version 1.0.3)

sim.accel.decel: Simulate an Unbiased Random Walk with an accelerating or decelerating rate of change through time.

Description

Function to simulate an evolutionary sequence data set according to an Unbiased Random Walk with an accelerating or decelerating rate of change through time.

Usage

sim.accel.decel(
  ns = 20,
  vs = 0.5,
  r = 0.2,
  vp = 0.2,
  nn = rep(20, ns),
  tt = 0:(ns - 1)
)

Value

An evolutionary sequence (time-series) data set (a paleoTS object)

Arguments

ns

number of samples in time-series

vs

step variance of the trait

r

the parameter controlling the exponential decay (if negative) or increase (if positive) of the rate (vs) through time.

vp

phenotypic variance of each sample

nn

vector of the number of individuals in each sample (identical sample sizes for all time-series is assumed)

tt

vector of sample times (ages

Author

Kjetil Lysne Voje

Examples

Run this code
##Simulate an unbiased random walk where the rate decelerates through time.
x<-sim.accel.decel(40, r=-0.5)

## Plot the data
plotevoTS(x)

Run the code above in your browser using DataLab