runSurface {surface} | R Documentation |
Run All Steps of a SURFACE Analysis
Description
Carries out both the forward and backward phases of SURFACE's stepwise AIC routine, with sensible default behaviors.
Usage
runSurface(tree, dat, exclude = 0, aic_threshold = 0, max_steps = NULL,
verbose = FALSE, plotaic = FALSE, error_skip = FALSE, only_best = FALSE,
sample_shifts=FALSE, sample_threshold = 2)
Arguments
tree |
Phylogenetic tree in |
dat |
Data frame with taxa names as rownames matching the tip labels of |
exclude |
Optionally, the proportion of the worst models (AICc scores for each shift point) to exclude in the current round of the forward phase (defaults to zero) |
aic_threshold |
Change in AICc needed to accept a candidate model as a sufficient improvement over the previous iteration of SURFACE. Defaults to zero, meaning any improvement in the AICc will be accepted; more stringent thresholds are specified using *negative* values of |
max_steps |
Maximum number of steps to allow to allow each phase to carry out (assuming the model improvement continues to exceed |
verbose |
A logical indicating whether to print progress (defaults to |
plotaic |
A logical indicating whether to plot AICc values of all candidate models at each step (defaults to |
only_best |
A logical indicating whether to only allow one pair of regimes to be collapsed at each iteration; if |
error_skip |
A logical indicating whether to skip over any candidate model that produces an error message during likelihood optimization (this is rare, but can cause an entire analysis to abort; defaults to |
sample_shifts |
A logical indicating whether to randomly sample from among the best models at each step (those within |
sample_threshold |
Number of AICc units within which to sample among candidate models that are close to as good as the best model at each step (defaults to 2, but only used if |
Details
Carries out all steps of SURFACE, including converting data structures and running both forward and backward phases of the analysis. The default behavior should be appropriate in most circumstances, but some functionalities require using the functions surfaceForward
and surfaceBackward
that are called by runSurface
Value
A list with two elements, fwd
and bwd
.
fwd |
The results of the forward phase, as returned by |
bwd |
The results of the backward phase, as returned by |
Author(s)
Travis Ingram
References
Butler, M.A. & King, A.A. (2004) Phylogenetic comparative analysis: a modeling approach for adaptive evolution. American Naturalist 164: 683-695.
Ingram, T. & Mahler, D.L. (2013) SURFACE: detecting convergent evolution from comparative data by fitting Ornstein-Uhlenbeck models with stepwise AIC. Methods in Ecology and Evolution 4: 416-425.
Mahler, D.L., Ingram, T., Revell, L.J. & Losos, J.B. (2013) Exceptional convergence on the macroevolutionary landscape in island lizard radiations. Science 341: 292-295.
See Also
surfaceBackward
, surfaceForward
Examples
## Not run:
data(surfaceDemo)
tree<-surfaceDemo$tree
dat<-surfaceDemo$sim$dat
result<-runSurface(tree,dat)
## End(Not run)