Hi Ravi, Thanks a lot for your informations. I think you are right. Without the constraints of the parameters, it's easy to get the "NaN Produced" warning message. The pdfs I worked on are Burr, Lognormal and Inverse Gaussian distributions. Lognormal distribution is ok, but I always have warning message to get mle for Burr and Inverse Gaussian. Also I found out that different initial values make difference. Some will get the valid MLE without warning message, some will have warning message. Don't why! Probably I have to try optimx() function. By the way, what is KKT test? Does optim() function have this output
I did get the MLE with convergence being 0. With your tips, I will assume that I have got the valid MLE even though I had the warning message. Also I tried to use proc nlmixed procedure in sas to estimate the MlE. It seems the optim() function and proc nlmixed give me the similar MLE. Regards -- View this message in context: http://r.789695.n4.nabble.com/question-on-optim-fn-tp3003217p3005004.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.