Re: [Rd] Calculation of e^{z^2/2} for a normal deviate z

2019-06-21 Thread Rui Barradas
Hello, Sorry, my mistake, I grossly misunderstood the question. qnorm(1e-300) #[1] -37.0471 Anyway, you cannot go much smaller. p <- 10^seq(-300, -400, by = -10) z <- qnorm(p/2) exp(z*z/2) Hope this helps, Rui Barradas Às 16:11 de 21/06/19, jing hua zhao escreveu: Dear Rui, Thanks for

Re: [Rd] Calculation of e^{z^2/2} for a normal deviate z

2019-06-21 Thread Rui Barradas
Hello, Well, try it: p <- .Machine$double.eps^seq(0.5, 1, by = 0.05) z <- qnorm(p/2) pnorm(z) # [1] 7.450581e-09 1.22e-09 2.026908e-10 3.343152e-11 5.514145e-12 # [6] 9.094947e-13 1.500107e-13 2.474254e-14 4.080996e-15 6.731134e-16 #[11] 1.110223e-16 p/2 # [1] 7.450581e-09 1.22e-09

Re: [Rd] Calculation of e^{z^2/2} for a normal deviate z

2019-06-21 Thread jing hua zhao
Hi Peter, Rui, Chrstophe and Gabriel, Thanks for your inputs -- the use of qnorm(., log=TRUE) is a good point in line with pnorm with which we devised log(p) as log(2) + pnorm(-abs(z), lower.tail = TRUE, log.p = TRUE) that could do really really well for large z compared to Rmpfr. Maybe I am

Re: [Rd] Calculation of e^{z^2/2} for a normal deviate z

2019-06-21 Thread Gabriel Becker
Hi Jing, Peter pointed out how you can, more or less, get numbers for this, and he's absolutely right. At the risk of giving unsolicited advice, though, Im don't think you *should* in this case. Someone on this list with more applied Statistics or Statistical Genetics experience can correct me

Re: [Rd] Suggested Patch: Library returns matching installed packages when typo present

2019-06-21 Thread Henrik Bengtsson
> On 6/21/19 10:56 AM, Tierney, Luke wrote: > [...] > Something that would be useful and is being considered is having a > mechanism for registering default condition handlers. This would allow > the condition to be re-signaled with a custom class and then having > a custom conditionMessage method

Re: [Rd] Calculation of e^{z^2/2} for a normal deviate z

2019-06-21 Thread peter dalgaard
You may want to look into using the log option to qnorm e.g., in round figures: > log(1e-300) [1] -690.7755 > qnorm(-691, log=TRUE) [1] -37.05315 > exp(37^2/2) [1] 1.881797e+297 > exp(-37^2/2) [1] 5.314068e-298 Notice that floating point representation cuts out at 1e+/-308 or so. If you want

Re: [Rd] Calculation of e^{z^2/2} for a normal deviate z

2019-06-21 Thread Christophe DUTANG
You should take a look at https://CRAN.R-project.org/package=Rmpfr Regards, Christophe Christophe Dutang CEREMADE, Univ. Paris Dauphine, PSL Univ., France Web : http://dutangc.free.fr

Re: [Rd] Suggested Patch: Library returns matching installed packages when typo present

2019-06-21 Thread Marcel Ramos
Hi Luke, Thank you for your response. On 6/21/19 10:56 AM, Tierney, Luke wrote: Thanks for the suggestion. However I don't think it is the right way to go. I also don't care for what install.packages() does. Signaling a warning and then an error means someone has to catch both the error and the

Re: [Rd] Calculation of e^{z^2/2} for a normal deviate z

2019-06-21 Thread jing hua zhao
Dear Rui, Thanks for your quick reply -- this allows me to see the bottom of this. I was hoping we could have a handle of those p in genmoics such as 1e-300 or smaller. Best wishes, Jing Hua From: Rui Barradas Sent: 21 June 2019 15:03 To: jing hua zhao;

[Rd] [Suggested patch] to fligner.test - constant values can produce significant results

2019-06-21 Thread Karolis K
In specific cases fligner.test() can produce a small p-value even when both groups have constant variance. Here is an illustration: fligner.test(c(1,1,2,2), c("a","a","b","b")) # p-value = NA But: fligner.test(c(1,1,1,2,2,2), c("a","a","a","b","b","b")) # p-value < 2.2e-16

Re: [Rd] [External] Suggested Patch: Library returns matching installed packages when typo present

2019-06-21 Thread Tierney, Luke
Thanks for the suggestion. However I don't think it is the right way to go. I also don't care for what install.packages() does. Signaling a warning and then an error means someone has to catch both the error and the warning, or suppress the warning, in order to handle the error programmatically.

[Rd] Calculation of e^{z^2/2} for a normal deviate z

2019-06-21 Thread jing hua zhao
Dear R-developers, I am keen to calculate exp(z*z/2) with z=qnorm(p/2) and p is very small. I wonder if anyone has experience with this? Thanks very much in advance, Jing Hua [[alternative HTML version deleted]] __ R-devel@r-project.org

[Rd] head with non integer n returns confusing output

2019-06-21 Thread Ant F
Dear all, `head()` returns a problematic output when a character is fed to its `n` parameter. doubles and logicals are converted to integer as if `as.integer` was used, which I think is intuitive enough : ``` head(1:10, 4.1) # [1] 1 2 3 4 head(1:10, 4.9) # [1] 1 2 3 4 head(1:10, TRUE) # 1

Re: [R-pkg-devel] Link compiled C object to internal package file

2019-06-21 Thread mark padgham
Dear All, Thanks for the input - it was sufficient for me to figure out a solution, which I'll briefly describe here for future reference. This draws primarily on the section of Writing R Extensions quoted by Martin Morgan below, giving rise to the idea of combining environmental variables, and