This function fits to a paleoTS object a model that starts in Stasis and shifts to either a unbiased or general random walk (models URW or GRW), 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, ...)opt.joint.RW.Stasis(y, gg, rw.model=c("URW", "GRW"), cl=list(fnscale=-1),
pool=TRUE, meth="L-BFGS-B", hess=FALSE)
opt.AD.RW.Stasis(y, gg, rw.model=c("URW", "GRW"), cl=list(fnscale=-1),
pool=TRUE, meth="L-BFGS-B", hess=FALSE)
opt.joint.Stasis.RW(y, gg, rw.model=c("URW", "GRW"), cl=list(fnscale=-1),
pool=TRUE, meth="L-BFGS-B", hess=FALSE)
opt.AD.Stasis.RW(y, gg, rw.model=c("URW", "GRW"), cl=list(fnscale=-1),
pool=TRUE, meth="L-BFGS-B", hess=FALSE)
logL.joint.URW.Stasis(p, y, gg)
logL.joint.GRW.Stasis(p, y, gg)
logL.joint.Stasis.URW(p, y, gg)
logL.joint.Stasis.GRW(p, y, gg)
a paleoTS
object
the minimum number of samples to require before and after the mode shift
logical, if TRUE, sample variances are replaced by their pooled estimate across all samples
either "Stasis-RW" or "RW-Stasis", setting the order of the two modes
either "GRW" or "URW", setting the random walk model to be unbaised (URW) or general/biased/directional (GRW)
parameterization to use: see Details
logical, if TRUE, results are not printed
logical, if TRUE, standard errors are computed from the Hessian matrix
further arguments, to be passed to optimization functions
vector of group membership, from shift2gg
control list for optimization
optimization method, can be "BFGS" or "L-BFGS-B"
parameter vectors for log-likelihood functions
A paleoTSfit
object, with additional elements:
log-likelihoods for all tested partitions of the series into segments
matrix of indices of initial samples of each tested segment configuration; each column of GG
corresponds to the elements of all.logl
Only the function fitStasisRW
is likely to be used by the user. The other functions are called directly or indirectly by this one.
The method
argument refers to different parameterizations of the model. See the documentation under opt.joint.GRW
for more information about the differences between these parameterizations.
Hunt, G., M. J. Hopkins, and S. L. Lidgard 2015. Simple versus complex models of trait evolution and stasis as a response to environmental change. PNAS 112:4885--4890.
# NOT RUN {
x<- sim.GRW(ns=30)
m.urw<- fitSimple(x, model="URW")
m.cplx<- fitModeShift(x, order="Stasis-RW", rw.model="URW", method="Joint")
compareModels(m.urw, m.cplx)
# }
Run the code above in your browser using DataLab