Classical statistical mechanics with nested sampling. (2017)