View source: R/complexModels.R
fitModeShift | R Documentation |
Trait evolution is modeled as a shift from a random walk (general or unbiased) to stasis, or vice versa.
fitModeShift(
y,
minb = 7,
pool = TRUE,
order = c("Stasis-RW", "RW-Stasis"),
rw.model = c("URW", "GRW"),
method = c("Joint", "AD"),
silent = FALSE,
hess = FALSE,
...
)
y |
|
minb |
minimum number of populations within each segment |
pool |
if TRUE, sample variances are substituted with their pooled estimate |
order |
whether stasis or random walk come first, one of |
rw.model |
whether the random walk segment is an unbiased random walk, |
method |
parameterization to use: |
silent |
logical, if TRUE, progress updates are suppressed |
hess |
if TRUE, standard errors computed from the Hessian matrix are returned |
... |
other arguments, passed to optimization functions |
a paleoTSfit
object
sim.Stasis.RW
x <- sim.Stasis.RW(ns = c(15, 15), omega = 0.5, ms = 1, order = "Stasis-RW")
plot(x)
w <- fitModeShift(x, order = "Stasis-RW", rw.model = "GRW")
abline(v = x$tt[15], lwd = 3) # actual shift point
abline(v = x$tt[w$par["shift1"]], lty = 3, lwd = 2, col = "red") # inferred shift
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.