Learn R Programming

paleoTS (version 0.3-1)

opt.joint.GRW: Optimize evolutionary models (joint parameterization)

Description

Functions to find maximum likelihood solutions to general random walk (opt.joint.GRW), unbiased random walk (opt.joint.URW), stasis (opt.joint.Stasis) and OU models (opt.joint.OU).

Usage

opt.joint.GRW(x, pool = TRUE, cl = list(fnscale = -1), meth = "L-BFGS-B", hess = FALSE)
opt.joint.URW(x, pool = TRUE, cl = list(fnscale = -1), meth = "L-BFGS-B", hess = FALSE)
opt.joint.Stasis(x, pool = TRUE, cl = list(fnscale = -1), meth = "L-BFGS-B", hess = FALSE)
opt.joint.OU(x, pool = TRUE, cl = list(fnscale = -1), meth = "L-BFGS-B", hess = FALSE)

Arguments

x
a paleoTS object
pool
logical indicating whether to pool variances 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

Value

  • parparameter estimates
  • valuethe log-likelihood of the optimal solution
  • countsreturned by optim
  • convergencereturned by optim
  • messagereturned by optim
  • p0initial guess for parameter values at start of optimization
  • Knumber of parameters in the model
  • nthe number of observations, equal to the number of samples
  • AICAkaike information criterion
  • AICcbias-corrected Akaike information criterion
  • BICBayes (or Schwarz) information criterion
  • sestandard errors for parameter estimates, computed from the curvature of the log-likelihood surface (only if hess = TRUE)
  • ...other output from call to optim

Warning

Measures of model fit (log-likelihoods, AIC scores, etc) are not comparable between the two parameterizations.

Details

These functions numerically search a log-likelihood surface for its optimum--they are a convenient wrapper to optim. Arguments meth, cl, and hess are passed to optim; see the help for that function for details. These are included to allow sophisticated users greater control over the optimization; the defaults seem to work well for most, but not all sequences. For meth="L-BFGS-B", some parameters are constrained to be non-negative, which is useful parameters which cannot truly be negative, such as vstep (random walk) and omega (stasis model). Initial estimates to start the optimization come in part from analytical solutions based on assuming equal sampling error across samples and evenly spaced samples in time (functions mle.GRW, mle.URW and mle.Stasis).

References

Hunt, G. 2006. Fitting and comparing models of phyletic evolution: random walks and beyond. Paleobiology32:578--601. Hunt, G., M. Bell & M. Travis. 2008. Evolution towards a new adaptive optimum: phenotypic evolution in a fossil stickleback lineage. Evolution 62:700-710.

See Also

logL.joint.GRW, opt.GRW

Examples

Run this code
x<- sim.GRW(ns=30, ms=1, vs=1)
 plot(x)
 
 # easier to use  fit3models.joint() 
 m.urw<- opt.joint.URW(x)
 m.grw<- opt.joint.GRW(x)
 m.sta<- opt.joint.Stasis(x)
 
 cat(m.urw$AICc, m.grw$AICc, m.sta$AICc, "")	# print AICc scores

Run the code above in your browser using DataLab