I am both new to maximum likelihood and writing loop functions in R. I am playing around with maximum likelihood code from Matlab and I\'m wondering how to transcribe it int