While doing #43, I ran into a pathological case when there is no normalisation done while running forward-backward algorithm and when both the mutation rate and recombination rate are very low (1e-6). It led to comparisons of extremely low log-likelihood values (nearly 1e-15), which failed a relative difference test.
To work around this problem, I refactored how combinations of input data and parameters are generated and fed to the tests. First, I added an extra parameter include_extreme_rates to core.get_examples_pars to specify whether to include extreme parameter values. Second, in the class of tests TestNonTreeForwardBackwardDiploid (where the pathological case occurred), I added an extra parameter normalise to verify to control when to run tests with normalisation. This allows for running tests that include extreme values when normalisation is done.
While doing #43, I ran into a pathological case when there is no normalisation done while running forward-backward algorithm and when both the mutation rate and recombination rate are very low (1e-6). It led to comparisons of extremely low log-likelihood values (nearly 1e-15), which failed a relative difference test.
To work around this problem, I refactored how combinations of input data and parameters are generated and fed to the tests. First, I added an extra parameter
include_extreme_rates
tocore.get_examples_pars
to specify whether to include extreme parameter values. Second, in the class of testsTestNonTreeForwardBackwardDiploid
(where the pathological case occurred), I added an extra parameternormalise
toverify
to control when to run tests with normalisation. This allows for running tests that include extreme values when normalisation is done.