Source: https://www2.mat.ulaval.ca/fileadmin/Cours/STT-2902/Notes_de_cours/A12_ERN/Regression3_notes.pdf