ABSTRACT Non-Gaussian likelihoods, ubiquitous throughout cosmology, are a direct consequence of non-linearities in the physical model. Their treatment requires Monte Carlo Markov chain (MCMC) or more advanced sampling methods for the determination of confidence contours. As an alternative, we construct canonical partition functions as Laplace transforms of the Bayesian evidence, from which MCMC methods would sample microstates. Cumulants of order n of the posterior distribution follow by direct n-fold differentiation of the logarithmic partition function, recovering the classic Fisher-matrix formalism at second order. We connect this approach for weakly non-Gaussianities to the DALI and Gram−Charlier expansions and demonstrate the validity with a supernova-likelihood on the cosmological parameters Ωm and w. We comment on extensions of the canonical partition function to include kinetic energies in order to bridge to Hamilton Monte Carlo sampling, and on ensemble Markov-chain methods, as they would result from transitioning to macrocanonical partition functions depending on a chemical potential. Lastly we demonstrate the relationship of the partition function approach to the Cramér−Rao boundary and to information entropies.