sim.covTrack: Simulate trait evolution that tracks a covariate

sim.covTrackR Documentation

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
)

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

Value

a paleoTS object

Note

For a trait sequence of length ns, the covariate, z, can be of length ns - 1,in which case it is interpreted as the vector of changes, dz. If z is of length ns, differences are taken and these are used as the dz's.

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

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

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