Simulate time-series that tracks a covariate

Share:

Description

Function to simulate a time-series of trait values in which each evolutionary increment is linearly related to changes in a covariate

Usage

1
2
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

Details

See opt.covTrack for a description of the model.

Value

An object of class paleoTSfit

Author(s)

Gene Hunt

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

1
2
3
4
5
 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)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.