View source: R/complexModels.R
opt.punc | R Documentation |
Fit a model of trait evolution with specified punctuation(s)
opt.punc(
y,
gg,
pool = TRUE,
cl = list(fnscale = -1),
meth = "L-BFGS-B",
hess = FALSE,
oshare
)
opt.joint.punc(
y,
gg,
pool = TRUE,
cl = list(fnscale = -1),
meth = "L-BFGS-B",
hess = FALSE,
oshare
)
y |
a |
gg |
vector of indices indicating different segments |
pool |
if TRUE, sample variances are substituted with their pooled estimate |
cl |
optional control list, passed to |
meth |
optimization algorithm, passed to |
hess |
if TRUE, return standard errors of parameter estimates from the |
oshare |
logical, if TRUE, variance assumed to be shared (equal) across segments |
The sequence is divided into segments, which are separated by punctuations. Means for
each segment are given by the vector theta
with variances given by the vector
omega
(or a single value if oshare = TRUE
). This function calls optim
to numerically fit this model to a time-series, y.
a paleoTSfit
object with the results of the model fitting
opt.joint.punc()
: fits the punctuation model using the joint parameterization
These functions would be used in the uncommon situation in which there
is a prior hypothesis as to where the punctuation(s) take place. Normally
users will instead use the function fitGpunc
, which uses these
functions to fit a range of possible timings for the punctuations.
fitGpunc
x <- sim.punc(ns = c(15, 15), theta = c(0,3), omega = c(0.1, 0.1))
w.sta <- fitSimple(x, model = "Stasis", method = "Joint")
w.punc <- opt.joint.punc(x, gg = rep(1:2, each = 15), oshare = TRUE)
compareModels(w.sta, w.punc)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.