Learn R Programming

paleoTS (version 0.6.2)

sim.covTrack: Simulate trait evolution that tracks a covariate

Description

Simulate trait evolution that tracks a covariate

Usage

sim.covTrack(
  ns = 20,
  b = 1,
  evar = 0.1,
  z,
  nn = rep(20, times = ns),
  tt = 0:(ns - 1),
  vp = 1
)

Value

a paleoTS object

Arguments

ns

number of populations in a sequence

b

slope of the relationship between the change in the covariate and the change in the trait

evar

residual variance of the same relationship

z

vector of covariate that the trait tracks

nn

vector of sample sizes for populations

tt

vector of times (ages) for populations

vp

phenotypic trait variance within each population

Details

In this model, changes in a trait are linearly related to changes in a covariate with a slope of b and residual variance evar: dx = b * dz + eps, where eps ~ N(0, evar). This model was described, and applied to an example in which body size changes tracked changes in temperature, by Hunt et al. (2010).

References

Hunt, G, S. Wicaksono, J. E. Brown, and K. G. Macleod. 2010. Climate-driven body size trends in the ostracod fauna of the deep Indian Ocean. Palaeontology 53(6): 1255-1268.

Examples

Run this code
set.seed(13)
z <- c(1, 2, 2, 4, 0, 8, 2, 3, 1, 9, 4, 3)
x <- sim.covTrack(ns = 12, z = z, b = 0.5, evar = 0.2)
plot(x, ylim = c(-1, 10))
lines(x$tt, z, col = "blue")

Run the code above in your browser using DataLab