Re: [Rd] What should dnorm(0, 0, -Inf) return?

2019-12-07 Thread Wang Jiefei
Good question, I cannot speak for R's developers but I would like to provide some information on the problem. Here are the first few lines of the dnorm function located at src\nmath\dnorm.c: ``` double dnorm4(double x, double mu, double sigma, int give_log) { #ifdef IEEE_754 if (ISNAN(x) || IS

[Rd] What should dnorm(0, 0, -Inf) return?

2019-12-07 Thread Weigand, Stephen D. via R-devel
Hi, Apropos of a recent Inf question, I've previously wondered if dnorm "does the right thing" with dnorm(0, 0, -Inf) which gives zero. Should that be zero or NaN (or NA)? The help says "'sd < 0' is an error and returns 'NaN'" and since -Inf < 0 is TRUE, then... is this a bug? Thank you, S

Re: [Rd] Inconsistent behavior for the C AP's R_ParseVector() ?

2019-12-07 Thread Laurent Gautier
Thanks for the quick response Tomas. The same error is indeed happening when trying to have a zero-length variable name in an environment. The surprising bit is then "why is this happening during parsing" (that is why are variables assigned to an environment) ? We are otherwise aware that the err

Re: [Rd] Inconsistencies in wilcox.test

2019-12-07 Thread Karolis Koncevičius
Thank you for a fast response. Nice to see this mailing list being so alive. Regarding Inf issue: I agree with your assessment that Inf should not be removed. The code gave me an impression that Inf values were intentionally removed (since is.finite() was used everywhere, except for paired ca

Re: [Rd] Inconsistencies in wilcox.test

2019-12-07 Thread Martin Maechler
> Karolis Koncevičius > on Sat, 7 Dec 2019 20:55:36 +0200 writes: > Hello, > Writing to share some things I've found about wilcox.test() that seem a > a bit inconsistent. > 1. Inf values are not removed if paired=TRUE > # returns different results (Inf is removed

Re: [Rd] Inconsistencies in wilcox.test

2019-12-07 Thread Karolis Koncevičius
Thank you for responding, and so quickly at that. Yes, I do understand that this is a floating point issue. However, since wilcox.test() works on ranks this might be a bit dangerous in my opinion. Maybe more so than for magnitude based tests. Any small precision error will be ranked and it becom

Re: [Rd] Inconsistencies in wilcox.test

2019-12-07 Thread Ben Bolker
Your second issue seems like a more or less unavoidable floating-point computation issue. The paired test operates by computing differences between corresponding values of x and y. It's not impossible to try to detect "almost-ties" (by testing for differences less than, say, sqrt(.Machine$do

[Rd] Inconsistencies in wilcox.test

2019-12-07 Thread Karolis Koncevičius
Hello, Writing to share some things I've found about wilcox.test() that seem a a bit inconsistent. 1. Inf values are not removed if paired=TRUE # returns different results (Inf is removed): wilcox.test(c(1,2,3,4), c(0,9,8,7)) wilcox.test(c(1,2,3,4), c(0,9,8,Inf)) # returns the same result (Inf

Re: [Rd] long vector support

2019-12-07 Thread Martin Maechler
> Will L > on Fri, 6 Dec 2019 16:02:59 -0500 writes: > All, At first glance, a recent commit to R-devel ( > https://github.com/wch/r-source/commit/2c182014ecc8c2407a89092c9162d86046bd18da) > appears to be related to long vector support. yes, for a very limited case, with