compareRateModels: Performs pairwise likelihood ratio comparisons on a list of...

View source: R/asr_diagnostics.R

compareRateModelsR Documentation

Performs pairwise likelihood ratio comparisons on a list of rate models

Description

Performs pairwise likelihood ratio comparisons on a list of rate models

Usage

compareRateModels(
  rate_models,
  treesObj,
  phenvals,
  nsims = 100,
  nested_only = FALSE,
  return_type = "pvals",
  ...
)

Arguments

rate_models

a named list of rate models in matrix form

treesObj

the trees object returned by readTrees

phenvals

the named phenotype vector with names matching the tip labels on the tree

nsims

the number of simulations to use in getLRnullDistribuutions when the rate models are not nested

nested_only

a boolean indicating whether comparisons should only be made between nested models. If TRUE, this decreases runtime because simulations to get the null distribution are not performed.

return_type

can be "pvals" or "ratios" indicating whether to return p values obtained from the likelihood ratios or the likelihood ratios themselves

...

additional parameters for the castor function, fit_mk used to fit the transition matrix

Value

a square matrix of p-values or likelihood ratios for pairwise comparisons between rate models


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