<div dir="ltr"><div dir="ltr"><div><div dir="ltr" class="gmail-m_714106316932620599gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>On Thu, Jul 26, 2018 at 3:09 PM Dirk Eddelbuettel <<a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a>> wrote:<br></div></div></div></div></div></div></div></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">So can you detail why the working example from nloptr does not suffice for<br>
you?  Because Jelmer has still not released that nloptr version to CRAN?  Or<br>
is there another reason?<br></blockquote><div><br></div><div>Ok let's try an answer...  there are several reasons.</div><div><br></div><div>As a researcher in (computational) statistics, I need to get access to efficient, scalable  optimization methods to fit some new statistical models. It seems natural to me to try an check any new fancy solution provided by the community, like the one offered by Keith. Moreover, I also often need to tune a bit the optimization algorithms at play <span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">for my particular problems: t</span>he solution offered by Keith, which uses armadillo, is great because it makes writing C++ code (and especially algebra) so easy even for a statistician. I also always like to check if some particular implementation is more robust or faster than another.</div><div><br></div><div>You could answer me that nloptr also offers an interface to armadillo with the solution that you provided : that is right, and thank you again for that ! However, there is an optimization method from the orignal NLOPT library (called CCSA) working well for a particular problem that I have (see the git repo <a href="https://github.com/jchiquet/PLNmodels">https://github.com/jchiquet/PLNmodels</a>) which is curiously not exported in nloptr. I thus chose to develop this particular R package by asking the user to install a system nlopt during the install process on R via a config file (eg. via message asking for apt-get install libnlopt-dev for Linux or brew install for Mac OS and... sorry for Windows users for now). Then I can link directly to the system nlopt to get access to the headers and to the CCSA algorithm. I also like this solution because it bypasses R during the optimisation process (calling many times objective and gradient functions) and thus avoids overheads implied by calls to R functions. But in that case the time saved is not so impressive, so if Jelmer finally put an updated version with both export to C++ headers and CCSA algorithm, I would go back to nloptr R to help the portability (especially for Windows users). CRAN or github is not and problem to me as long as the R package and the associated stat method are at a "research" stage.</div><div><br></div><div>And a final reason: I also wanted to learn how to properly wrap a C++ library in a R package, an I thought that the optim package from Keith was a good opportunity for this, that could eventually help the community a bit.</div><div><br></div><div>Best,</div><div><br></div><div>j</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Dirk<br>
<br>
-- <br>
<a href="http://dirk.eddelbuettel.com" rel="noreferrer" target="_blank">http://dirk.eddelbuettel.com</a> | @eddelbuettel | <a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a><br>
</blockquote></div></div></div>