Source: http://mathsv.univ-lyon1.fr/pdf/mathsv-TestChi2-dfo.pdf