Franco, Is it possible that you have failed to provide the negative of loglikelihood to "optim", since optim, by default, minimizes a function? If you want to do this withput redefining the log-likelihood, you should set fnscale= -1 (as hinted by Prof. Ripley). This would turn the problem into a maximization problem.
If this doesn't work, you should provide more details (a reproducible code with actual error message). Ravi. ---------------------------------------------------------------------------- ------- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division of Geriatric Medicine and Gerontology Johns Hopkins University Ph: (410) 502-2619 Fax: (410) 614-9625 Email: [EMAIL PROTECTED] Webpage: http://www.jhsph.edu/agingandhealth/People/Faculty/Varadhan.html ---------------------------------------------------------------------------- -------- -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of francogrex Sent: Friday, January 05, 2007 10:42 AM To: [email protected] Subject: Re: [R] maximum likelihood estimation of 5 parameters Franco, You can provide lower and upper bounds on the parameters if you use optim with method="L-BFGS-B". Hth, Ingmar Thanks, but when I use L-BFGS-B it tells me that there is an error in optim(start, f, method = method, hessian = TRUE, ...) : L-BFGS-B needs finite values of 'fn' -- View this message in context: http://www.nabble.com/maximum-likelihood-estimation-of-5-parameters-tf292536 4.html#a8180120 Sent from the R help mailing list archive at Nabble.com. ______________________________________________ [email protected] 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. ______________________________________________ [email protected] 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.
