Master equation, Anderson localization and statistical mechanics