Re: [Rd] Wrongly converging glm()

2017-07-21 Thread Mark Leeds
H Ravi: Yes, IIRC that's EXACTLY what was going on in my case. Based on the codes from Rvmmin, the objective functon wasn't changing much and I think norm of the gradient was close to zero so it was difficult for me to detect the issue. I found it when I happenered to notice that the objective fun

Re: [Rd] Wrongly converging glm()

2017-07-21 Thread Ravi Varadhan
“So, what I learned the hard way was termination due to reasonable stopping criteria DOES NOT NECESSARILY EQUAL OPTIMAL.” Yes, I agree, Mark. Let me add another observation. In the “optimx” package, John Nash and I implemented a check for optimality conditions – first and second order KKT c

Re: [Rd] Wrongly converging glm()

2017-07-21 Thread Mark Leeds
Hi Ravi: Well said. In John's Rvmmin package, he has codes for explaining the cause of the termination. The codes returned were fine. The problem was that the model I was using could have multiple solutions ( regardless of the data sent in ) so, even though the stopping criteria was reached, it tur

Re: [Rd] [PATCH] Fix missing break

2017-07-21 Thread Steve Grubb
Hello Martin, On Friday, July 21, 2017 4:21:21 AM EDT Martin Maechler wrote: > I have now created an account for you. Thanks. Is that the preferred method of transferring these patches? > >> In examples like the one below, if you have R code that shows symptoms, > >> it would really help in the

Re: [Rd] [PATCH] Fix bad free in connections

2017-07-21 Thread Steve Grubb
On Friday, July 21, 2017 5:03:09 AM EDT Martin Morgan wrote: > b gets reallocated when > > res = vasprintf(&b, format, ap); > > is successful and res >= 0. usedVasprintf is then set to TRUE, and > free(b) called. > > It seems like the code is correct as written? Yes, I think I see the issu

Re: [Rd] [PATCH] Fix fscanf specifier in InIntegerAscii

2017-07-21 Thread Martin Maechler
> Steve Grubb > on Thu, 20 Jul 2017 17:28:53 -0400 writes: > Hello, > The SMBUF_SIZED_STRING allows fscanf to read upto 511 bytes. The buffer > at line 1382 is only 128 bytes. The fscanf format specifier ought to be > resized to prevent a stack overrun. Yes, you are r

Re: [Rd] [PATCH] Fix memory leak in PicTeXDeviceDriver

2017-07-21 Thread Martin Maechler
> Steve Grubb > on Thu, 20 Jul 2017 17:06:52 -0400 writes: > Hello, > This patch fixes a memory leak due to ptd going out of scope > before its assigned to dd. Hmm, I'm not an expert here, but I tend to say that it may not be a memory leak because the corresponding funct

Re: [Rd] Wrongly converging glm()

2017-07-21 Thread Ravi Varadhan
Please allow me to add my 3 cents. Stopping an iterative optimization algorithm at an "appropriate" juncture is very tricky. All one can say is that the algorithm terminated because it triggered a particular stopping criterion. A good software will tell you why it stopped - i.e. the stopping

Re: [Rd] Wrongly converging glm()

2017-07-21 Thread Therneau, Terry M., Ph.D.
I'm chiming in late since I read the news in digest form, and I won't copy the entire conversation to date. The issue raised comes up quite often in Cox models, so often that the Therneau and Grambsch book has a section on the issue (3.5, p 58). After a few initial iterations the offending co

[Rd] 'gsub' not perl compatible?

2017-07-21 Thread Lipatz Jean-Luc
Hi all, Working on some SAS program conversions, I was testing this (3.4.0 Windows, but also 2.10.1 MacOsX): gsub("b?","!","abc",perl=T) which returns [1] "!a!c!" that I didn't understand. Unfortunately, asked for the same thing SAS 9.4 replies : "!a!!c!", and so does Perl (Strawberry 5.26),

Re: [Rd] [PATCH] Fix bad free in connections

2017-07-21 Thread Martin Morgan
On 07/20/2017 05:04 PM, Steve Grubb wrote: Hello, There are times when b points to buf which is a stack variable. This leads to a bad free. The current test actually guarantees the stack will try to get freed. Simplest to just drop the variable and directly test if b should get freed. Signed-o

Re: [Rd] [PATCH] Fix missing break

2017-07-21 Thread Martin Maechler
> Martin Morgan > on Fri, 21 Jul 2017 03:43:48 -0400 writes: > On 07/20/2017 05:02 PM, Steve Grubb wrote: >> Hello, >> >> There appears to be a break missing in the switch/case for the LISTSXP case. >> If this is supposed to fall through, I'd suggest a comment so

Re: [Rd] [PATCH] Fix status in main

2017-07-21 Thread Martin Maechler
> Hello, > This is a patch to fix what appears to be a simple typo. The warning says > "invalid status assuming 0", but then instead sets runLast to 0. > Signed-of-by: Steve Grubb > Index: src/main/main.c > === > --- src/main/main.

Re: [Rd] [PATCH] Fix missing break

2017-07-21 Thread Martin Maechler
> Steve Grubb > on Thu, 20 Jul 2017 22:20:33 -0400 writes: > On Thursday, July 20, 2017 7:41:00 PM EDT Duncan Murdoch wrote: >> Thanks for posting this series of patches. Unfortunately, there's a >> good chance they'll get lost in all the traffic on R-devel. If you >

Re: [Rd] [PATCH] Fix status in main

2017-07-21 Thread Martin Morgan
On 07/20/2017 05:31 PM, Steve Grubb wrote: Hello, This is a patch to fix what appears to be a simple typo. The warning says "invalid status assuming 0", but then instead sets runLast to 0. Signed-of-by: Steve Grubb fixed in 72938 / 39. This seemed not to have consequence, since exit() repor

Re: [Rd] [PATCH] Fix missing break

2017-07-21 Thread Martin Morgan
On 07/20/2017 05:02 PM, Steve Grubb wrote: Hello, There appears to be a break missing in the switch/case for the LISTSXP case. If this is supposed to fall through, I'd suggest a comment so that others know its by design. Signed-off-by: Steve Grubb An example is $ R --vanilla -e "pl = pairli