Skip to content

Commit

Permalink
Scale paths correspondingly after topology update in compute_estimate…
Browse files Browse the repository at this point in the history
…s_rates_and_branches
  • Loading branch information
xjlizji committed Feb 21, 2019
1 parent 2a1578b commit 368677c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@
doc/auto
bin

src/prog/evosim
test/
pyscripts/
rscripts/
12 changes: 11 additions & 1 deletion src/common/ParamEstimation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -464,10 +464,20 @@ compute_estimates_rates_and_branches(const bool VERBOSE,
estimate_rates_and_branches(param_tol, J, D,
the_model.triplet_rates, th.branches,
updated_rates, updated_branches);

set_one_change_per_site_per_unit_time(updated_rates, updated_branches);
the_model.rebuild_from_triplet_rates(updated_rates);
th.branches = updated_branches;

// scale jump times
for (size_t b = 1; b < all_paths.size(); ++b) {
for (size_t i = 0; i < all_paths[b].size(); ++i) {
const double scale = th.branches[b] / all_paths[b][i].tot_time;
for (size_t j = 0; j < all_paths[b][i].jumps.size(); ++j) {
all_paths[b][i].jumps[j] *= scale;
}
all_paths[b][i].tot_time = th.branches[b];
}
}
}


Expand Down

0 comments on commit 368677c

Please sign in to comment.