[R] Passing Command to Optim in factanal

Ravi Varadhan RVaradhan at jhmi.edu
Tue Nov 3 20:00:04 CET 2009


Hi,

The function `factanal' calls `factanal.fit.mle' to perform the likelihood
maximization. You can take a look at this function by saying:

getAnywhere("factanal.fit.mle")

If you do this, you will see that there is a call to `optim' and there you
will see that the only method used is "L-BFGS-B", because there are bounds
on the parameters.  I don't know where you got the idea that "BFGS" can be
used.  

One option is to replace the call to `optim' with a call to `nlminb', but I
am not sure whether this would solve your problem.

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

Webpage:
http://www.jhsph.edu/agingandhealth/People/Faculty_personal_pages/Varadhan.h
tml

 

----------------------------------------------------------------------------
--------

-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On
Behalf Of Ali Torkamani
Sent: Tuesday, November 03, 2009 1:30 PM
To: r-help at r-project.org
Subject: [R] Passing Command to Optim in factanal

Hi,

I am currently trying to execute the following command:

f<-factanal(factors=k$Components$nparallel,covmat=m,n.obs=2287,rotation="var
imax",control=list(opt=list(method=c("BFGS"))))

but keep getting the error: L-BFGS-B needs finite values of 'fn'

I can't figure out what I am doing wrong here, why isn't optim being told to
use BFGS instead of L-BFGS-B...

Any help would be very muc appreciated.

Thanks,
Ali
______________________________________________
R-help at 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.




More information about the R-help mailing list