Description Usage Arguments Details Value See Also Examples

View source: R/phylogeny_bootstrap.R

Takes a given shift configuration previously detected from data along with shift magnitudes and OU parameters, to calculate bootstrap support for shift positions. The non-parametric bootstrap procedure calculates phylogenetically-uncorrelated standardized residuals, one at each node. These residuals are sampled with replacement, then mapped back onto the tree to create bootstrap replicates. Each replicate is analyzed with the l1ou method and user-specified options.

1 2 | ```
l1ou_bootstrap_support(model, nItrs = 100, multicore = FALSE, nCores = 2,
quietly = TRUE)
``` |

`model` |
an object output by |

`nItrs` |
number of independent iterations (bootstrap replicates). |

`multicore` |
logical. If TRUE, nCores processes are used in parallel. |

`nCores` |
desired number of parallel processes. |

`quietly` |
logical. If FALSE, a summary of each iteration will be printed out. |

The results of sequential and parallel runs are not necessarily equal, because different seeds might be used for different bootstrap replicates.
For multiple cores to be used, the `parallel`

library needs to be installed.
To change options for the analysis of each bootstrap replicate,
like the information criterion or the maximum allowed number of shifts, modify model$opt.

vector of size the number of edges in the tree. Each entry is the proportion of bootstrap replicates for which a shift is detected on the corresponding edge.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ```
data(lizard.traits, lizard.tree)
Y <- lizard.traits[,1]
eModel <- estimate_shift_configuration(lizard.tree, Y)
result <- l1ou_bootstrap_support(eModel, nItrs=2)
# using only 2 replicates in vastly insufficient in general,
# but used here to make the illustrative example run faster.
nEdges <- Nedge(lizard.tree)
e.w <- rep(1,nEdges)
e.w[eModel$shift.configuration] <- 3
e.l <- round(result$detection.rate*100, digits=1)
# to avoid annotating edges with support at or below 10%
e.l <- ifelse(e.l>10, paste0(e.l,"%"), NA)
plot(eModel, edge.label=e.l, edge.ann.cex=0.7, edge.label.ann=TRUE, cex=0.5, label.offset=0.02, edge.width=e.w)
Y <- lizard.traits[,1:2]
eModel <- estimate_shift_configuration(lizard.tree, Y)
result <- l1ou_bootstrap_support(eModel, nItrs=2, multicore=TRUE, nCores=4)
result$detection.rate
``` |

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.