Simulate an Unbiased Random Walk with an accelerating or decelerating rate of change through time.
Source:R/sim.accel.decel.R
sim.accel.decel.Rd
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)
)
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
Examples
##Simulate an unbiased random walk where the rate decelerates through time.
x<-sim.accel.decel(40, r=-0.5)
## Plot the data
plotevoTS(x)