return nan if no marginals are computed