set cost function to neg log likelihood