Skip to content

Commit d7934a3

Browse files
Tweak values to work for k=3 example
1 parent ddd02e6 commit d7934a3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

sc2ts/inference.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -805,15 +805,16 @@ def solve_num_mismatches(ts, k):
805805
# on how low we can push the HMM precision. We should be able to solve
806806
# for the optimal value of this parameter such that the magnitude of the
807807
# values within the HMM are as large as possible (so that we can truncate
808-
# usefully). This value is probably close for k=3 (it fails for k=2).
809-
mu = 1e-2
808+
# usefully).
809+
mu = 1e-3
810810
denom = (1 - mu) ** k + (n - 1) * mu**k
811811
r = n * mu**k / denom
812812
assert mu < 0.5
813813
assert r < 0.5
814814

815-
# Add a tiny bit of extra mass for recombination so that we deterministically
815+
# Add a little bit of extra mass for recombination so that we deterministically
816816
# chose to recombine over k mutations
817+
# NOTE: the magnitude of this value will depend also on mu, see above.
817818
r += r * 0.01
818819
ls_recomb = np.full(m - 1, r)
819820
ls_mismatch = np.full(m, mu)

0 commit comments

Comments
 (0)