This directory contains unit tests for branch length estimators in the Cassiopeia library, specifically focusing on two classes: IIDExponentialBayesian and IIDExponentialMLE. These tests are designed to validate the functionality and accuracy of these estimators under various scenarios, including edge cases, hand-solvable problems, and simulated data.
The tests in this directory serve several purposes:
Validate the correctness of the IIDExponentialBayesian estimator by comparing its output to closed-form solutions and numerical approximations for log likelihood, log joints, and posterior time distributions.
Verify the behavior of the IIDExponentialMLE estimator in various scenarios, including:
Degenerate cases (no mutations or saturation)
Hand-solvable problems with simple tree topologies
Regression tests on small trees
Performance on simulated data
Handling of subtree collapses when no mutations are present
Enforcement of minimum branch length constraints
Incorporation of site-specific mutation rates
Ensure proper error handling for invalid inputs or edge cases in both estimators.
These tests help maintain the reliability and accuracy of the branch length estimation algorithms in the Cassiopeia library, which is crucial for phylogenetic analysis and lineage tracing applications.
The tests do not rely on external configuration files or environment variables. However, they do use various parameters to configure the estimators and test scenarios:
For IIDExponentialBayesian:
mutation_rate: The mutation rate of the model.
birth_rate: The birth rate of the model.
sampling_probability: The sampling probability of the model.
discretization_level: The number of timesteps used to discretize time.
For IIDExponentialMLE:
solver: The optimization solver to use (ECOS or SCS).
minimum_branch_length: A constraint on the minimum allowed branch length.
These parameters are set within the test methods to create various test scenarios and validate the estimators’ behavior under different conditions.In summary, this directory contains comprehensive unit tests for two branch length estimators in the Cassiopeia library, ensuring their accuracy and reliability across a wide range of scenarios and input conditions.