Re: [Rd] R-devel Digest, Vol 112, Issue 8

2012-06-09 Thread John C Nash
I'll not be able to comment on the use of C like this, but will warn that I wrote the routines that became Nelder-Mead, CG, and BFGS in optim() in the mid 1970s. CG never did as well as I would like, but the other two routines turned out pretty well. However, in nearly 40 years, there are a few

[Rd] How to set up an object to share data across diverse functions

2012-05-15 Thread John C Nash
In the past 6 months I've been struggling with an issue that has been raised periodically on the lists. This is the need to share information across a group of functions, possibly from different packages. So far I've found solutions that are either quite clumsy or else don't work as have (likely

[Rd] Converting expression to a function

2012-03-18 Thread John C Nash
Previously, I've posted queries about this, and thanks to postings and messages in response have recently had some success, to the extent that there is now a package called nlmrt on the R-forge project https://r-forge.r-project.org/R/?group_id=395 for solving nonlinear least squares problems tha

Re: [Rd] bug in sum() on integer vector

2011-12-14 Thread John C Nash
orderings on sums of large numbers of items. JN On 12/14/2011 03:58 PM, Uwe Ligges wrote: > > > On 14.12.2011 17:19, peter dalgaard wrote: >> >> On Dec 14, 2011, at 16:19 , John C Nash wrote: >> >>> >>> Following this thread, I wondered why nobody

Re: [Rd] bug in sum() on integer vector

2011-12-14 Thread John C Nash
Following this thread, I wondered why nobody tried cumsum to see where the integer overflow occurs. On the shorter xx vector in the little script below I get a message: Warning message: Integer overflow in 'cumsum'; use 'cumsum(as.numeric(.))' > But sum() does not give such a warning, which I

[Rd] Detecting typo in function argument

2011-12-12 Thread John C Nash
With some chagrin after spending a couple of hours trying to debug a script, I realized I had typed in something like ans<-optimx(start, myfn, mygr, lower<-lo, upper=up) that is, the "<-" rather than "=". The outcome on my machine was a non-obvious error several layers deep in the call stack. F

Re: [Rd] testing on platforms, was Fortran error

2011-11-21 Thread John C Nash
I think the poster is interested in being able to try the build/check on a Mac in the fashion that Winbuilder does. That is, rather than have CRAN do all the platform checks, is there a way to submit a package to be tested for just one platform? It may be useful to have such a facility so packag

Re: [Rd] overly long lines in pdf output of manual from package

2011-11-02 Thread John C Nash
Thanks for quick reply. To help others I'll put in short comments in edited thread. On 11/02/2011 03:54 PM, Prof Brian Ripley wrote: > On Wed, 2 Nov 2011, John C Nash wrote: > >> In re-factoring my optimx package, I'm finding that the pdf output has some >> l

[Rd] overly long lines in pdf output of manual from package

2011-11-02 Thread John C Nash
In re-factoring my optimx package, I'm finding that the pdf output has some lines that are outside the margins (and there are warnings in R CMD check optimx). Clearly I can fix this by editing the tex file that is generated, but the build infrastructure would still get things wrong in automatic

[Rd] list of operations that preserve attributes

2011-10-19 Thread John C Nash
I've been trying to prepare some wrappers for optimization objective functions and gradients that use try() to check for computable functions. I'm also trying to do scaling as per optim() so that a number of methods that are available on CRAN and R-Forge can use parameter and function scaling. T

[Rd] control list gotcha

2011-09-10 Thread John C Nash
This is mainly a reminder to others developing R packages to be careful not to supply control list items that are not used by the called package. Optimx is a wrapper package that aims to provide a common syntax to a number of existing optimization packages. Recently in extending optimx package I

[Rd] An example of very slow computation

2011-08-17 Thread John C Nash
This message is about a curious difference in timing between two ways of computing the same function. One uses expm, so is expected to be a bit slower, but "a bit" turned out to be a factor of >1000. The code is below. We would be grateful if anyone can point out any egregious bad practice in ou

Re: [Rd] R-devel Digest, Vol 101, Issue 2

2011-07-02 Thread John C Nash
I've been finding that the "loose ends" in many of these older codes cause more trouble than it is worth in their use. When I encounter them, I've attempted to re-program the algorithm in R. A lot of the Fortran code is because of the software structure the author used and nothing to do with the

[Rd] Default values in control list of function

2011-06-25 Thread Prof. John C Nash
In building a function for a package, I'd like to set the defaults in a control list, e.g., makeg<-function(parameters, eps = 1.0e-7, control=list(showwork=TRUE, rubbish=1.0e+101)){ etc. } This does not provide showwork or rubbish within the function if control() is not fully specified.

Re: [Rd] return(); was Suggestions for "good teaching" packages

2011-02-16 Thread Prof. John C Nash
I tend to code with return(), at least in development, because I've once stepped in the cowpad of ans<- list() then attr(ans ) and forgot to do another ans so got only part of what I wanted. Perhaps its just my thinking style, but I agree with some others who suggest that it

Re: [Rd] Google Summer of Code 2011 - credit where it is due

2011-02-15 Thread Prof. John C Nash
In my reminder that GSoC project proposals are requested (to R wiki developers' projects page for GSoC 2011), I mentioned that Dirk Eddelbuettel had acted as leader for the R Foundation activity on GSoC prior to handing the torch to Claudia Beleites and I for this year. I should have mentioned t

[Rd] Google Summer of Code 2011

2011-02-15 Thread Prof. John C Nash
The 2011 Google Summer of Code will soon be open for organizations to submit potential projects for which students may apply (with detailed plans) for funding. We have some proposals in process at http://rwiki.sciviews.org/doku.php?id=developers:projects:gsoc2011 Note that projects do need to h

[Rd] Competing with one's own work

2010-12-03 Thread Prof. John C Nash
No, this is not about Rcpp, but a comment in that overly long discussion raised a question that has been in my mind for a while. This is that one may have work that is used in R in the base functionality and there are improvements that should be incorporated. For me, this concerns the BFGS, Nel

Re: [Rd] [R] DBLEPR?

2010-11-17 Thread Prof. John C Nash
Thanks for comments from several folk, fix from Doug Bates and start to finding new email for ucminf maintainer. Summary of responses: DBLEPR and its relations are briefly mentioned but with no or minimal examples in Writing R Extensions as well as Venables and Ripley book. I should have emphas

Re: [Rd] DBLEPR?

2010-11-16 Thread Prof. John C Nash
My reaction is leaning heavily towards "Virtuoso!" as opposed to "Show Off!". Thanks very much. JN On 11/16/2010 05:39 PM, Douglas Bates wrote: > Try this. > > On Tue, Nov 16, 2010 at 4:06 PM, Prof. John C Nash wrote: >> We've tried to contact Sti

Re: [Rd] DBLEPR?

2010-11-16 Thread Prof. John C Nash
. JN On 11/16/2010 04:52 PM, Douglas Bates wrote: > On Tue, Nov 16, 2010 at 2:35 PM, Prof. John C Nash wrote: >> I normally see digest once per day, but got msg from Doug Bates so >> responding with context. > >> UCMINF is a package on CRAN that implements a variable me

Re: [Rd] DBLEPR?

2010-11-16 Thread Prof. John C Nash
I normally see digest once per day, but got msg from Doug Bates so responding with context. UCMINF is a package on CRAN that implements a variable metric minimizer. It does quite well on unconstrained problems. Stig Mortensen packaged the Fortran version for R, but is not at moment responding t

Re: [Rd] BLAS benchmarks on R 2.12.0 and related performance issues

2010-11-02 Thread Prof. John C Nash
This thread pointed out that the "plain vanilla" library for linear algebra outperformed the fancy ones for the original poster -- and he had mentioned this, but still got "you ought to " advice that was inappropriate and ignored his stated experience. I've been surprised sometimes myself wi

Re: [Rd] iteration count in optim()

2010-08-06 Thread Prof. John C Nash
Date: Fri, 6 Aug 2010 11:14:37 +0200 From: Christophe Dutang To: r-devel@r-project.org Subject: [Rd] on the optim function Message-ID: <7e004a07-03e1-4ded-a506-6c564edb6...@gmail.com> Content-Type: text/plain; charset=us-ascii Dear useRs, I have just discovered that the R optim function does

[Rd] transpose of complex matrices in R

2010-07-30 Thread Prof. John C Nash
When one is working with complex matrices, "transpose" very nearly always means *Hermitian* transpose, that is, A[i,j] <- Conj(A[j,i]). One often writes A^* for the Hermitian transpose. I believe that I have actually (many years ago) used a true complex transpose, but I agree that one more of

[Rd] Location of source code for readline()

2010-05-30 Thread Prof. John C Nash
A few days ago on R-help I asked about a cross-platform timeout version of readline(). Some suggestions, but only partial joy so far. I can get the Gnu bash 'read -t ...' to work in Windows by using the 'bash -c ' construct, but then R's system() function does not seem to allow this to pass thr

Re: [Rd] R CMD check issue with soft-linked directory

2010-03-10 Thread Prof. John C Nash
Good catch Simon. Changed fstab to force exec on mount of the drive in question and things worked. Thanks, JN Simon Urbanek wrote: On Mar 10, 2010, at 12:43 , Prof. John C Nash wrote: I've been having some strange problems with R CMD check in the last couple of days, but now beli

[Rd] R CMD check issue with soft-linked directory

2010-03-10 Thread Prof. John C Nash
I've been having some strange problems with R CMD check in the last couple of days, but now believe I have localized the issue. I had been running Ubuntu Hardy on one drive and then upgraded to Jaunty, but put Jaunty on a different drive. I continue to be able to boot Hardy when I wish. I soft-

[Rd] Idea for install.packages on (certain) linux distributions

2010-03-02 Thread Prof. John C Nash
Some time ago, I had some email discussion with Dirk E. about putting a front-end on install.packages to first look at the debian repositories for R and use them before trying to install from source. The code for this would not be very large. As Uwe points out in another posting, the issue then

[Rd] [R] R CMD check when package directory is symlinked

2009-12-16 Thread Prof. John C Nash
I've done a couple of searches and not found mention of the issue below, though some older scripts mention getting absolute paths for R CMD check. If the issue is "new" or unfamiliar I'll be happy to follow up and document it, but suspect it is in some sense already known and I've missed the rig

Re: [Rd] Buglet in optim() SANN

2009-10-25 Thread Prof. John C Nash
e-based methods, and ‘500’ for ‘"Nelder-Mead"’. > For ‘"SANN"’ ‘maxit’ gives the total number of function > evaluations. There is no other stopping criterion. >^^^^ > Defaults to ‘1000

[Rd] Advice on how to arrange fix of buglet

2009-10-22 Thread Prof. John C Nash
Recently I reported a small bug in optim's SANN method failing to report that it had exceeded the maximum function evaluation limit in the convergence code. This is a small enough matter that I was reluctant to create a full-blown bug report. Indeed in the optimx package Ravi Varadhan and I h

[Rd] Buglet in optim() SANN

2009-10-20 Thread Prof. John C Nash
I think SANN method in optim() is failing to report that it has not converged. Here is an example genrose.f<- function(x, gs=NULL){ # objective function ## One generalization of the Rosenbrock banana valley function (n parameters) n <- length(x) if(is.null(gs)) { gs=100.0 }

[Rd] Why license filtering is important (was non-GPL ...)

2009-09-12 Thread Prof. John C Nash
Using the acronym "GPL" in comments on the management of package repositories led the discussion well away from the issues I wanted to shed light upon, so I have changed the subject tag. Examples of my concerns: 1) I use a package with a non-free component and learn how to work with it effici

Re: [Rd] Non-GPL packages for R

2009-09-11 Thread John C Nash
License filters will work for me. My offer stands to help on documentation,or to act as a "stooge" to test tools in this area. Thanks to those who responded. And for myself, "GPL compatible" was my intended expression. JN __ R-devel@r-project.org ma

Re: [Rd] Non-GPL packages for R

2009-09-11 Thread Prof. John C Nash
The responses to my posting yesterday seem to indicate more consensus than I expected: 1) CRAN should be restricted to GPL-equivalent licensed packages 2) r-forge could be left "buyer beware" using DESCRIPTION information 3) We may want a specific repository for restricted packages (RANC?) How t

[Rd] Non-GPL packages for R

2009-09-10 Thread Prof. John C Nash
Subject: Non-GPL packages for R Packages that are not licensed in a way that permits re-distribution on CRAN are frequently a source of comment and concern on R-help and other lists. A good example of this problem is the Rdonlp2 package that has caused a lot of annoyance for a number of optimiza

Re: [Rd] identical(0, -0)

2009-08-08 Thread Prof. John C Nash
I'll save space and not include previous messages. My 2 cents: At the very least the documentation needs a fix. If it is easy to do, then Ted Harding's suggestion of a switch (default OFF) to check for sign difference would be sensible. I would urge inclusion in the documentation of the +0, -

Re: [Rd] Automatic Differentiation for R

2009-05-19 Thread John C Nash
Martin (see below) gives a good explanation of the difference between AD and symbolic differentiations. I'm of the opinion we can use both. However, the real issue as far as I'm concerned (from an optimizer's point of view, which may also be that of ODE and PDE folk) is that right now none of t

[Rd] nlminb - Port library codes

2009-05-01 Thread John C Nash
Having looked at documentation and codes, I'm still looking to find out who did the installation of the Port libraries. As I work on optimization code improvements, there are often choices of settings (tolerances etc.), and I'd prefer to learn if there are particular reasons for choices before

[Rd] (Not quite) Automatic Differentiation

2009-04-15 Thread John C Nash
Many thanks to Gabor Grothendieck for responding to my posting about Automatic Differentiation (invite from Shaun Forth for interaction with R developers) showing how one might use rSymPy and symbolic (rather than automatic) differentiation to get a function that computes gradients. See http:/

Re: [Rd] Automatic Differentiation for R

2009-04-15 Thread John C Nash
In efforts to improve optimization tools for R, one of my interests has been getting automatic differentiation capabilities so that analytic rather than numerical derivatives can be used. They would be helpful in several other areas besides optimization, My timings show factors of the order of 1