https://medium.com/@monocosmo77/working-with-conditional-likelihood-part1-machine-learning-97de2bfba646