https://functions.pythonprogramminghelp.com/how-to-create-negative-log-likelihood-functions/