opt.alt.GRW {paleoTSalt} | R Documentation |
Functions to find maximum likelihood solutions to general random walk (opt.alt.GRW
), unbiased random walk (opt.alt.URW
), stasis (opt.alt.Stasis
) and OU models (opt.alt.OU
).
opt.alt.GRW(x, pool = TRUE, cl = list(fnscale = -1), meth = "L-BFGS-B", hess = FALSE) opt.alt.URW(x, pool = TRUE, cl = list(fnscale = -1), meth = "L-BFGS-B", hess = FALSE) opt.alt.Stasis(x, pool = TRUE, cl = list(fnscale = -1), meth = "L-BFGS-B", hess = FALSE) opt.alt.OU(x, pool = TRUE, cl = list(fnscale = -1), meth = "L-BFGS-B", hess = FALSE)
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 |
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
).
par |
parameter estimates |
value |
the log-likelihood of the optimal solution |
counts |
returned by optim |
convergence |
returned by optim |
message |
returned by optim |
p0 |
initial guess for parameter values at start of optimization |
K |
number of parameters in the model |
n |
the number of observations, equal to the number of samples |
AIC |
Akaike information criterion |
AICc |
bias-corrected Akaike information criterion |
BIC |
Bayes (or Schwarz) information criterion |
se |
standard errors for parameter estimates, computed from the curvature of the log-likelihood surface (only if hess = TRUE ) |
... |
other output from call to optim |
Because these functions parameterize the models differently, their outputs are not comparable to those from paleoTS
package.
These optimizations are performed with a parameterization of the GRW, URW and Stasis models that differs from the
package paleoTS
(the OU model is not implemented in that package). Specifically, in paleoTS
, models are
fit from the differences between adjacent samples, removing the autocorrelation in the time-series. In package
{paleoTSalt}, models are fit using the actual sample values, with the autocorrelation among samples accounted for in
the log-likelihood function. With each model, the joint distribution of sample means is multivariate normal, with means
and variance-covariances determined by evolutionary parameters and sampling errors.
For details on this parameterization of the models, see the upcoming paper in Evolution by G. Hunt, M. Bell and M. Travis.
Gene Hunt
Hunt, G. 2006. Fitting and comparing models of phyletic evolution: random walks and beyond. Paleobiology32:578–601.
x<- sim.GRW(ns=30, ms=1, vs=1) plot(x) m.urw<- opt.alt.URW(x) m.grw<- opt.alt.GRW(x) m.sta<- opt.alt.Stasis(x) cat(m.urw$AICc, m.grw$AICc, m.sta$AICc, "\n") # print AICc scores