Learn R Programming

paleoTS (version 0.4-4)

opt.covTrack: Covariate-tracking model

Description

Functions to fit a model in which a phenotpyic trait tracks changes in a measured covariate (e.g., body size tracks temperature changes).

Usage

opt.covTrack(y, z, pool = TRUE, cl = list(fnscale = -1), meth = "L-BFGS-B", hess = FALSE)
opt.covTrack.Mult(yl, zl, cl = list(fnscale = -1), pool = TRUE, hess = FALSE)
logL.covTrack(p, y, z)
logL.Mult.covTrack(p, yl, zl)

Arguments

y
a paleoTS object
z
a measured covariate. See Details about its required length.
pool
logical, if TRUE, variance are pooled across samples
cl
control list, passed to function optim
meth
optimization method, passed to function optim
hess
logical, indicating whether to calculate standard errors from the Hessian matrix
yl
a list of paleoTS objects
zl
a list of covariates, corresponding to yl
p
a vector of parameter values

Value

  • An object of class paleoTSfit

Details

These functions model the changes in a phenotpyic trait as linear functions of changes in a covariate, z. Each change in z (=dz) yields an expected change in the trait equal to b*dz, with normally distributed residual variance evar. If z is equal in length to the trait sequence, first differences are taken. If z is of length one less than the trait sequence, it is assumed that the user has already taken the appropriate difference.

For the Mult versions of these, the function estimates the model assuming the same relationship exists across all sequences.

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

as.paleoTSfit, opt.GRW

Examples

Run this code
z<- rnorm(20)
 x<- sim.covTrack(ns=20, b=2, evar=0.1, z=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)
 mct<- opt.covTrack(x, z)
 print(round(mct$parameters,2))  # should be close to generating values
 print(x$genpar)

Run the code above in your browser using DataLab