Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kuhner-Felsenstein distance metric #3

Open
pierrebarbera opened this issue Mar 15, 2016 · 0 comments
Open

Kuhner-Felsenstein distance metric #3

pierrebarbera opened this issue Mar 15, 2016 · 0 comments

Comments

@pierrebarbera
Copy link
Collaborator

Related to #1, there could be a function for calculating the Kuhner-Felsenstein distance between two trees, as described in Kuhner and Felsenstein, 94, Equation (1).

auto distance = 0.0;
for(auto bipartition : bipartition_map_a) {
  auto other = find(bipartition_map_b, bipartition);
  auto other_length = other ? other.edge_length : 0.0;
  distance += pow(bipartition.edge_length - other_length, 2);
}

Maybe this could be written in such a way that the actual distance can be easily exchanged? As in, the body of the for sans the find could be passed as a functional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants