maximum likelihood estimation in r package