Source: https://math.unice.fr/~diener/MpB2009-2010/STAT1-2.pdf