Title: | Phylogenetic Monte Carlo |
---|---|
Description: | Monte Carlo based model choice for applied phylogenetics of continuous traits. Method described in Carl Boettiger, Graham Coop, Peter Ralph (2012) Is your phylogeny informative? Measuring the power of comparative methods, Evolution 66 (7) 2240-51. <doi:10.1111/j.1558-5646.2011.01574.x>. |
Authors: | Carl Boettiger [aut, cre] |
Maintainer: | Carl Boettiger <[email protected]> |
License: | CC0 |
Version: | 1.0.6 |
Built: | 2024-10-27 03:19:08 UTC |
Source: | https://github.com/cboettig/pmc |
as from ouch with additional regimes added and minor formatting changes
Performs a phylogenetic monte carlo between modelA and modelB
pmc( tree, data, modelA, modelB, nboot = 500, optionsA = list(), optionsB = list(), ..., mc.cores = parallel::detectCores() )
pmc( tree, data, modelA, modelB, nboot = 500, optionsA = list(), optionsB = list(), ..., mc.cores = parallel::detectCores() )
tree |
A phylogenetic tree. Can be phylo (ape) or ouch tree |
data |
The data matrix |
modelA |
a model from the list, or a custom model, see details |
modelB |
any other model from the list, or custom model, see details |
nboot |
number of bootstrap replicates to use |
optionsA |
additional arguments to modelA |
optionsB |
additional arguments to modelB |
... |
additional arguments to both fitting methods |
mc.cores |
number of parallel cores to use |
Simulates data under each model and returns the distribution of likelihood ratio, L(B)/L(A), under for both simulated datasets.
list with the nboot likelihood ratios obtained from fitting both models to data simulated by model A, and the nboot likelihood ratios obtained by fitting both models to simulations from model B, and the likelihood ratio between the original MLE estimated models from the data.
library("geiger") geo=get(data(geospiza)) tmp=treedata(geo$phy, geo$dat) phy=tmp$phy dat=tmp$data[,1] pmc(phy, dat, "BM", "lambda", nboot = 20, mc.cores=1)
library("geiger") geo=get(data(geospiza)) tmp=treedata(geo$phy, geo$dat) phy=tmp$phy dat=tmp$data[,1] pmc(phy, dat, "BM", "lambda", nboot = 20, mc.cores=1)
The fitting function used by pmc to generalize fitting to both geiger and ouch models.
pmc_fit(tree, data, model, ...)
pmc_fit(tree, data, model, ...)
tree |
a phylogenetic tree. can be ouch or ape format |
data |
trait data in ape or ouch format |
model |
the name of the model to fit, |
... |
whatever additional options would be provided to the model fit |
the object returned by the model fitting routine (gfit for geiger, hansen/brown for ouch)
simulate method for gfit objects
simulate.gfit(object, nsim = 1, seed = NULL, ...)
simulate.gfit(object, nsim = 1, seed = NULL, ...)
object |
a gfit object |
nsim |
number of sims |
seed |
an optional seed for the simulations (not implemented) |
... |
additional arguments, not implemented for gfit simulations |
simulated dataset
update method for gfit objects
update.gfit(object, ...)
update.gfit(object, ...)
object |
a gfit object |
... |
additional arguments, such as the data to use to update |
updated gfit object