This function fits a model of punctuated change that is is protracted enough that it is captured by multiple transitional populations. Trait evolution starts in stasis, shifts to a general random walk, and then shifts back into stasis.
fit.sgs(
y,
minb = 7,
oshare = TRUE,
pool = TRUE,
silent = FALSE,
hess = FALSE,
meth = "L-BFGS-B",
model = "GRW"
)
a paleoTSfit
object
a paleoTS
object
minimum number of populations within each segment
logical, if TRUE, variance assumed to be shared (equal) across segments
if TRUE, sample variances are substituted with their pooled estimate
logical, if TRUE, progress updates are suppressed
if TRUE, standard errors computed from the Hessian matrix are returned
optimization method, passes to optim
type of random walk: "URW"
, unbiased random walk, or "GRW"
,
a general (directional) random walk
fitGpunc
x <- sim.sgs(ns = c(10, 10, 10)) # default values OK
w <- fit.sgs(x, minb = 8) # increase minb so example takes less time; not recommended!
plot(x)
abline(v = c(16, 31), lwd = 3) # actual shifts
abline(v = c(w$parameters[6:7]), lwd = 2, lty = 3, col = "red") # inferred shifts
Run the code above in your browser using DataLab