Source: http://dmo.econ.msu.ru/Teaching/stat/Sem_2/ex2_corr.htm.pdf