Learn R Programming

paleoTS (version 0.6.2)

sim.punc: Simulate a punctuated time-series

Description

Simulates punctuated trait evolution with punctuations that are rapid relative to the spacing of samples. In practice, the time-series is divided into two or more segments, each of which has its own mean and variance.

Usage

sim.punc(
  ns = c(10, 10),
  theta = c(0, 1),
  omega = rep(0, length(theta)),
  nn = rep(30, sum(ns)),
  tt = 0:(sum(ns) - 1),
  vp = 1
)

Value

a paleoTS object with the simulated time-series.

Arguments

ns

vector of the number of samples in each segment

theta

vector of means, one for each segment

omega

vector of variances, one for each segment.

nn

vector of sample sizes, one for each population

tt

vector of times (ages), one for each population

vp

phenotypic variance within each population

Details

Segments are separated by punctuations. Population means in the ith segment are drawn randomly from a normal distribution with a mean equal to ith element of theta and variance equal to the ith element of omega. The magnitudes of punctuations are determined by the differences in adjacent theta values.

See Also

fitGpunc

Examples

Run this code
x <- sim.punc(ns = c(15, 15), theta = c(0,3), omega = c(0.1, 0.1))
plot(x)

Run the code above in your browser using DataLab