Package 'pmc'

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:04:37 UTC
Source: https://github.com/cboettig/pmc

Help Index


The anoles data set

Description

as from ouch with additional regimes added and minor formatting changes


pmc

Description

Performs a phylogenetic monte carlo between modelA and modelB

Usage

pmc(
  tree,
  data,
  modelA,
  modelB,
  nboot = 500,
  optionsA = list(),
  optionsB = list(),
  ...,
  mc.cores = parallel::detectCores()
)

Arguments

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

Details

Simulates data under each model and returns the distribution of likelihood ratio, L(B)/L(A), under for both simulated datasets.

Value

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.

Examples

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)

Fit any model used in PMC

Description

The fitting function used by pmc to generalize fitting to both geiger and ouch models.

Usage

pmc_fit(tree, data, model, ...)

Arguments

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

Value

the object returned by the model fitting routine (gfit for geiger, hansen/brown for ouch)


simulate gfit

Description

simulate method for gfit objects

Usage

simulate.gfit(object, nsim = 1, seed = NULL, ...)

Arguments

object

a gfit object

nsim

number of sims

seed

an optional seed for the simulations (not implemented)

...

additional arguments, not implemented for gfit simulations

Value

simulated dataset


The phylogeny for the anoles data set

Description

The bimaculus phylogeny, as from the ouch package


update gfit

Description

update method for gfit objects

Usage

update.gfit(object, ...)

Arguments

object

a gfit object

...

additional arguments, such as the data to use to update

Value

updated gfit object