bootSimpleComplex: Bootstrap test to see if a complex model is significantly...

View source: R/complexModels.R

bootSimpleComplexR Documentation

Bootstrap test to see if a complex model is significantly better than a simple model.


Bootstrap test to see if a complex model is significantly better than a simple model.


  nboot = 99,
  minb = 7,
  ret.full.distribution = FALSE,
  parallel = FALSE,



a paleoTS object


a paleoTSfit object, representing the model fit of a simple model


a paleoTSfit object, representing the model fit of a complex model


number of replications for parametric bootstrapping


minimum number of populations within each segment


logical, indicating if the null distribution for the likelihood ratio from the parametric bootstrap should be returned


logical, if TRUE, the bootstrapping is done using parallel computing


further arguments, passed to optimization functions


Simulations suggest that AICc can be overly liberal with complex models with mode shifts or punctuations (Hunt et al., 2015). This function implements an alternative of parametric bootstrapping to compare the fit of a simple model with a complex model. It proceeds in five steps:

  1. Compute the observed gain in support from the simple to complex model as the likelihood ratio, LR_obs = -2(logL_simple - logL_complex)

  2. Simulate trait evolution under the specified simple model nboot times

  3. Fit to each simulated sequence the specified simple and complex models

  4. Measure the gain in support from simple to complex as the bootstrap likelihood ratio for each simulated sequence

  5. Compute the P-value as the percentile of the bootstrap distribution corresponding to the observed LR.

Argument simpleFit should be a paleoTS object returned by the function fitSimple or similar functions (e.g., opt.joint.GRW, opt.GRW, etc.). Argument complexFit must be a paleoTS object returned by fitGpunc or fitModeShift.

Calculations can be sped up by setting parallel = TRUE, which uses functions from the doParallel package to run the bootstrap replicates in parallel, using one fewer than the number of detected cores.


A list of the observed likelihood ratio statistic, LRobs, the P-value of the test, and the number of bootstrap replicates. If ret.full.distribution = TRUE, the null distribution of likelihood ratios generated by parametric bootstrapping is also returned.


Hunt, G., M. J. Hopkins and S. Lidgard. 2015. Simple versus complex models of trait evolution and stasis as a response to environmental change. PNAS 112(16): 4885-4890.

See Also

sim.Stasis.RW, fitModeShift


## Not run: 
x <- sim.Stasis.RW(ns = c(15, 15), omega = 0.5, ms = 1, order = "Stasis-RW")
ws <- fitSimple(x)
wc <- fitModeShift(x, order = "Stasis-RW", rw.model = "GRW")
bootSimpleComplex(x, ws, wc, nboot = 50, minb = 7)  # nboot too low for real analysis!

## End(Not run)

paleoTS documentation built on Aug. 9, 2022, 1:06 a.m.