fixed bias_from_marginals