Source: https://www.uni-ulm.de/fileadmin/website_uni_ulm/mawi.inst.110/lehre/ss12/stoch1/R-skript.pdf