The localization of energy in the discrete nonlinear Schroedinger equation is explained with statistical methods. The partition function and the entropy of the system are computed for low-amplitude initial conditions. Detailed predictions for the long-time solution are derived.