[R] About the efficiency of R optimization function
spencerg
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:
library(RSiteSearch)
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.)
HTML(ipm..)
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
'install.packages("RSiteSearch", repos="http://R-Forge.R-project.org")'.
Hope this helps.
Spencer Graves
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!!
>
> Popo
>
> 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
>>> variables,
>>> 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
>>>
>> loop
>>
>>> 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
>>> me.
>>> 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.
>>>
>>> Popo
>>>
>>>
>>>
>> 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
>> "Source"
>> section of the help page for optim states that the code for the
>> Nelder-Mead,
>> 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
>> to
>> shared libraries that can be loaded by R using dyn.load().
>>
>> -Charlie
>>
>>
>>
>>
>> -----
>> Charlie Sharpsteen
>> Undergraduate
>> Environmental Resources Engineering
>> Humboldt State University
>> --
>> View this message in context:
>> http://www.nabble.com/About-the-efficiency-of-R-optimization-function-tp23552061p23552668.html
>> Sent from the R help mailing list archive at Nabble.com.
>>
>> ______________________________________________
>> 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<http://www.r-project.org/posting-guide.html>
>> and provide commented, minimal, self-contained, reproducible code.
>>
>>
>>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> 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