Using statistical ensembles