https://www.jstatsoft.org/article/view/v054i01