pmc: pmc

View source: R/pmc.R

pmcR Documentation

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)


pmc documentation built on Oct. 3, 2023, 1:07 a.m.