Large deviations theory