[R] maximum likelihood estimation of 5 parameters

Ravi Varadhan rvaradhan at jhmi.edu
Fri Jan 5 17:42:59 CET 2007

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 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: rvaradhan at jhmi.edu

Webpage:  http://www.jhsph.edu/agingandhealth/People/Faculty/Varadhan.html



-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of francogrex
Sent: Friday, January 05, 2007 10:42 AM
To: r-help at stat.math.ethz.ch
Subject: Re: [R] maximum likelihood estimation of 5 parameters

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:
Sent from the R help mailing list archive at Nabble.com.

R-help at stat.math.ethz.ch mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list