Discrete trait evolution model comparison (fitDiscrete)

Compare ER, SYM, ARD Mk models

Command identity

Canonical command:

fit_discrete

Handler:

fit_discrete

Aliases:

fd, fitdiscrete

Standalone executables:

pk_fit_discrete, pk_fd, pk_fitdiscrete

Categories:

Trait evolution

Runtime interface

Synopsis

phykit fit_discrete --tree <tree> --trait_data <trait_data> --trait <trait> [--models <models>] [--json]

Arguments

This table is generated from the live command parser. It is the authoritative source for accepted spellings, required arguments, types, defaults, and choices.

Argument

Required

Type

Default

Choices

-t, --tree

true

str

required

any

-d, --trait_data

true

str

required

any

-c, --trait

true

str

required

any

--models

false

str

none

any

--json

false

boolean

false

any

Output and errors

--json provides the command's structured JSON representation. Unless the guidance below states otherwise, results are emitted as command output. Invalid command syntax exits with status 2. Input validation and scientific limitations are described in the guidance below.

Guidance, interpretation, and examples

Compare models of discrete trait evolution on a phylogeny. Fits ER (Equal Rates), SYM (Symmetric), and ARD (All Rates Different) Mk models of discrete character evolution via maximum likelihood. Compares models using AIC and BIC.

Analogous to R's geiger::fitDiscrete(). Cross-validated against R's geiger package.

phykit fit_discrete -t <tree> -d <trait_data> -c <trait>
        [--models ER,SYM,ARD] [--json]

Options:
-t/--tree: tree file (required)
-d/--trait_data: trait data file in TSV format (required)
-c/--trait: column name for the discrete trait in the data file (required)
--models: comma-separated list of models to fit (default: ER,SYM,ARD)
--json: optional argument to print results as JSON

R validation: Validated against geiger in R (see tests/r_validation/validate_fit_discrete.R).