View source: R/complexModels.R

bootSimpleComplex | R Documentation |

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

bootSimpleComplex( y, simpleFit, complexFit, nboot = 99, minb = 7, ret.full.distribution = FALSE, parallel = FALSE, ... )

`y` |
a |

`simpleFit` |
a |

`complexFit` |
a |

`nboot` |
number of replications for parametric bootstrapping |

`minb` |
minimum number of populations within each segment |

`ret.full.distribution` |
logical, indicating if the null distribution for the likelihood ratio from the parametric bootstrap should be returned |

`parallel` |
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:

Compute the observed gain in support from the simple to complex model as the likelihood ratio,

*LR_obs = -2(logL_simple - logL_complex)*-
Simulate trait evolution under the specified simple model

`nboot`

times Fit to each simulated sequence the specified simple and complex models

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

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.

`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)

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.