Source: https://ernst.r.perso.math.cnrs.fr/cours/Stat_Cours1.pdf