Tests if a complex model fit is significantly better than that of a simple model, treating the simple model as the null hypothesis and using the loglikelihood ratio as a test statistic.
1 2  bootSimpleComplex(y, simpleFit, complexFit, nboot = 99, minb = 7,
ret.full.distribution = FALSE, parallel = FALSE, ...)

y 
a 
simpleFit 
a 
complexFit 
a 
nboot 
number of boostrap replications 
minb 
the minimum number of segments to require before and after the mode shift 
ret.full.distribution 
logical, if TRUE, the vectore of test statistics for all replicates is returned 
parallel 
logical, if TRUE, the replicates are parallelized using 
... 
further arguments, passed to the optimization functions 
Simulations performed in Hunt et al. (2015) showed that the AICc can unduly favor complex models in this context. The behavior is known in other situations in which a large number of possible shifts are evaluated.
The parallel
option uses doParallel
and foreach
. It detects the number of available cores and uses that number minus one for the parallelization.
Returns a list
:
LRobs 
the observed loglikelihood ratio statistic 
p.value 
pvalue of the test 
nullLR 
optional, if 
Gene Hunt
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.
fit9models
, fitModeShift
1 2 3 4 5 6 7 8 9  x< sim.GRW(ns=40)
mS< fitSimple(x, model="URW", method="Joint")
mC< fitModeShift(x, order="StasisRW", rw.model="URW", method="Joint")
compareModels(mS, mC) ## AICc comparisons
boot< bootSimpleComplex(x, mS, mC, nboot=20)
cat("Bootstrap pvalue: ", boot$p.value, "\n")

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
All documentation is copyright its authors; we didn't write any of that.