Learn R Programming

paleoTS (version 0.4-1)

sim.covTrack: Simulate time-series that tracks a covariate

Description

Function to simulate a time-series of trait values in which each evolutionary increment is linearly related to changes in 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 samples in time-series
b
slope of the relationship between evolutionary changes and changes in the covaiate
evar
residual variance around covariate-trait relationship
z
a measured covariate
nn
vector of the number of individuals in each sample
tt
vector of sample ages, increases from oldest to youngest
vp
within-population trait variance

Value

  • An object of class paleoTSfit

Details

See opt.covTrack for a description of the model.

References

Hunt, et al. 2010. Climate-driven body-size trends in the ostracod fauna of the deep Indian Ocean, Palaeontology 53:1255--1268.

See Also

opt.covTrack, as.paleoTSfit

Examples

Run this code
z<- rnorm(20)
 x<- sim.covTrack(ns=20, b=2, evar=0.3, z)
 plot(diff(z), diff(x$mm), xlab="Change in covariate", ylab="Change in Trait")
 abline(h=0, lty=3)
 abline(v=0, lty=3)

Run the code above in your browser using DataLab