create_nll function

Creates the negative log-likelihood function create_nll Creates the negative log-likelihood function