[R] About the efficiency of R optimization function
spencer.graves at prodsyse.com
Sat May 16 05:58:09 CEST 2009
You might get some information about what is available in R using
the new "RSiteSearch" package. For example:
ipm <- RSiteSearch.function('interior point method')
hits(ipm) # 39
SQP <- RSiteSearch.function('SQP')
hits(SQP) # 2
sqp <- RSiteSearch.function('sequential quadratic programming')
hits(sqp) # 2
sqp. <- (sqp | SQP)
dim(sqp.) # 4 10
ipm.. <- (ipm | sqp.)
NOTE: The "|" = "unionRSiteSearch" function is available in
version 1.0-3, which was released earlier today and should arrive at
your favorite CRAN mirror tomorrow or Sunday. Or you can get it now via
Hope this helps.
popo UBC wrote:
> Hi Charlie,
> Thank you so much for suggestions!!
> Actually, I used the optimization toolbox in MABLAB before and I even wrote
> some numerical optimization programs by myself. As far as I know, some
> commercial optimization softwares had already replaced L-BFGS-B by more
> advanced algorithms, such as interior point method, SQP(sequential quadratic
> programming), implemented under trust region strategy. So,
> - Have you ever tried these techniques? Are they available in R already?
> - In your previous experieces, did R work satisfactory? I mean, was it
> often that R failed to converge or spent too much time?
> - Mainly, I need to calculate the MLE. But I really have no idea what the
> likelihood may looks like. According to your experiences, would the
> likelihood function be too complicated? Is L-BFGS-B good enough?
> Thanks again!!
> 2009/5/14 cls59 <sharpsteen at mac.com>
>> popo UBC wrote:
>>> Hi all!
>>> The objective function I want to minimize contains about 10 to 20
>>> maybe more in the future. I never solved such problems in R, so I had no
>>> idea about the efficiency of R's optimization functions. I know doing
>>> in R is quite slow, so I am not sure whether this shortage influences the
>>> speed of R's optimization functions.
>>> I would be very appreciated if anyone could share some experiences with
>>> The speed, stability of the R's optimization functions. Is it helpful to
>>> call a C/Fortran code to do the job, if possible.
>>> Many thanks in advance.
>> Many functions available in R are implemented using a compiled language
>> such as C or Fortran- not the R language it's self. For example, the
>> section of the help page for optim states that the code for the
>> BFGS and Conjugate Gradient methods were translated to C from Pascal and
>> then further optimized. The L-BFGS-B method appears to be implemented as
>> Fortran code.
>> Looking at the source of the optim function reveals that results are
>> computed by a call to .Internal(). Such calls usually indicate that R is
>> handing computations off to a compiled, rather than interpreted, routine.
>> If you have C or Fortran code you would prefer to use, take a look at the
>> help pages for .C() and .Fortran() as well as the "Writing R Extensions"
>> manual. The command line tool R CMD SHLIB will help you compile your code
>> shared libraries that can be loaded by R using dyn.load().
>> Charlie Sharpsteen
>> Environmental Resources Engineering
>> Humboldt State University
>> View this message in context:
>> Sent from the R help mailing list archive at Nabble.com.
>> R-help at r-project.org mailing list
>> PLEASE do read the posting guide
>> and provide commented, minimal, self-contained, reproducible code.
> [[alternative HTML version deleted]]
> R-help at r-project.org 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