sum_of_pairwise_marginals