def get_fixation_unconstrained_kb_fquad_cython(S, d, log_kb, mask): """ This uses the Kacser and Burns effect instead of the sign function. """ D = d * numpy.tanh(numpy.exp(log_kb) * S) H = 1. / kimrecessive.denom_fixed_quad_cython(0.5*S, D, mask) return H
def get_fixation_unconstrained_fquad_cython(S, d, mask): """ This is not compatible with algopy. In this function name, fquad means "fixed quadrature." The S ndarray with ndim=2 depends on free parameters. The d parameter is itself a free parameter. The mask specifies which codon pairs are mutational neighbors. @param S: array of selection differences @param d: parameter that controls dominance vs. recessivity @param mask: only compute entries of neighboring codon pairs """ H = 1. / kimrecessive.denom_fixed_quad_cython(0.5*S, d*numpy.sign(S), mask) return H