searchRateModels: iteratively searches for simpler rate models that still...

View source: R/asr_diagnostics.R

searchRateModelsR Documentation

iteratively searches for simpler rate models that still provide a good fit to the observed data at the tips of the tree

Description

iteratively searches for simpler rate models that still provide a good fit to the observed data at the tips of the tree

Usage

searchRateModels(
  treesObj,
  phenvals,
  pthreshold = 0.05,
  lthreshold = 4,
  max_iterations = 2000,
  ...
)

Arguments

treesObj

the trees object returned by readTrees

phenvals

the named phenotype vector with names matching the tip labels in the trees object

pthreshold

the more complex model is considered significantly better when the p value is less than pthrehsold

lthreshold

the more compelx model is considered significantly better when the likelihood ratio is greater than the lthreshold, used when the more complex and simpler models are not nested

max_iterations

stops the algorithm if the number of iterations exceeds max_iterations even if it isn't done in order to avoid extremely long runtimes

...

additional parameters ot pass to fit_mk, the castor function used to fit a transition matrix given a rate model, phylogenetic tree, and phenotype data

Value

returns a list of the rate models generated during the iterative search for simpler rate models and a table of statistics including the likelihood ratios computed on each iteration


nclark-lab/RERconverge documentation built on March 2, 2024, 8:51 a.m.