Analytic methods for cosmological likelihoods